diff --git a/codegen_mappings.json b/codegen_mappings.json index b15f7af802..b681dad419 100644 --- a/codegen_mappings.json +++ b/codegen_mappings.json @@ -668,6 +668,8 @@ "sql": { "resource-manager": { "packageName": "azure-arm-sql", + "packageVersion": "3.0.0", + "generateReadmeMd": true, "dir": "sqlManagement2", "source": "sql/resource-manager" } diff --git a/lib/services/sqlManagement2/LICENSE.txt b/lib/services/sqlManagement2/LICENSE.txt index 0313a903d7..a70e8cf660 100644 --- a/lib/services/sqlManagement2/LICENSE.txt +++ b/lib/services/sqlManagement2/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Microsoft +Copyright (c) 2018 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/lib/services/sqlManagement2/README.md b/lib/services/sqlManagement2/README.md index c0d7e0e514..e2cb47350b 100644 --- a/lib/services/sqlManagement2/README.md +++ b/lib/services/sqlManagement2/README.md @@ -1,7 +1,9 @@ -# Microsoft Azure SDK for Node.js - SQLManagement +# Microsoft Azure SDK for Node.js - SqlManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features -This project provides a Node.js package that makes it easy to manage Microsoft Azure SQL. -## Minimum node.js version >= 6.x.x ## How to Install @@ -9,29 +11,28 @@ This project provides a Node.js package that makes it easy to manage Microsoft A npm install azure-arm-sql ``` -## How to Use - -### Authentication, client creation and listing servers as an example - - ```javascript - const msRestAzure = require('ms-rest-azure'); - const SQLManagement = require("azure-arm-sql"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin().then((credentials) => { - let client = new SQLManagement(credentials, 'your-subscription-id'); - return client.servers.list(); - }).then((servers) => { - console.log('List of servers:'); - console.dir(servers, {depth: null, colors: true}); +## How to use + +### Authentication, client creation and get recoverableDatabases as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const SqlManagementClient = require("azure-arm-sql"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new SqlManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const serverName = "testserverName"; + const databaseName = "testdatabaseName"; + return client.recoverableDatabases.get(resourceGroupName, serverName, databaseName).then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { - console.log('An error ocurred'); - console.dir(err, {depth: null, colors: true}); - }); -``` + console.log('An error ocurred:'); + console.dir(err, {depth: null, colors: true}); +}); ## Related projects -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) \ No newline at end of file +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js b/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js new file mode 100644 index 0000000000..cc8a4107e0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/automaticTuningOptions.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Automatic tuning properties for individual advisors. + * + */ +class AutomaticTuningOptions { + /** + * Create a AutomaticTuningOptions. + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual + * state are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', + * 'QueryStoreReadOnly', 'NotSupported' + */ + constructor() { + } + + /** + * Defines the metadata of AutomaticTuningOptions + * + * @returns {object} metadata of AutomaticTuningOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'AutomaticTuningOptions', + type: { + name: 'Composite', + className: 'AutomaticTuningOptions', + modelProperties: { + desiredState: { + required: false, + serializedName: 'desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On', 'Default' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'actualState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On' ] + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'Number' + } + }, + reasonDesc: { + required: false, + readOnly: true, + serializedName: 'reasonDesc', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Disabled', 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', 'QueryStoreReadOnly', 'NotSupported' ] + } + } + } + } + }; + } +} + +module.exports = AutomaticTuningOptions; diff --git a/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js b/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js new file mode 100644 index 0000000000..139c420e84 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/automaticTuningServerOptions.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Automatic tuning properties for individual advisors. + * + */ +class AutomaticTuningServerOptions { + /** + * Create a AutomaticTuningServerOptions. + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual + * state are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured' + */ + constructor() { + } + + /** + * Defines the metadata of AutomaticTuningServerOptions + * + * @returns {object} metadata of AutomaticTuningServerOptions + * + */ + mapper() { + return { + required: false, + serializedName: 'AutomaticTuningServerOptions', + type: { + name: 'Composite', + className: 'AutomaticTuningServerOptions', + modelProperties: { + desiredState: { + required: false, + serializedName: 'desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On', 'Default' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'actualState', + type: { + name: 'Enum', + allowedValues: [ 'Off', 'On' ] + } + }, + reasonCode: { + required: false, + readOnly: true, + serializedName: 'reasonCode', + type: { + name: 'Number' + } + }, + reasonDesc: { + required: false, + readOnly: true, + serializedName: 'reasonDesc', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Disabled', 'AutoConfigured' ] + } + } + } + } + }; + } +} + +module.exports = AutomaticTuningServerOptions; diff --git a/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js b/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js index 380d2fc45e..59cab275c7 100644 --- a/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js +++ b/lib/services/sqlManagement2/lib/models/backupLongTermRetentionPolicy.js @@ -13,18 +13,21 @@ const models = require('./index'); /** - * A backup long term retention policy + * A long term retention policy. * * @extends models['ProxyResource'] */ class BackupLongTermRetentionPolicy extends models['ProxyResource'] { /** * Create a BackupLongTermRetentionPolicy. - * @member {string} [location] The geo-location where the resource lives - * @member {string} state The status of the backup long term retention - * policy. Possible values include: 'Disabled', 'Enabled' - * @member {string} recoveryServicesBackupPolicyResourceId The azure recovery - * services backup protection policy resource id + * @member {string} [weeklyRetention] The weekly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [monthlyRetention] The montly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {string} [yearlyRetention] The yearly retention policy for an LTR + * backup in an ISO 8601 format. + * @member {number} [weekOfYear] The week of year to take the yearly backup + * in an ISO 8601 format. */ constructor() { super(); @@ -68,28 +71,33 @@ class BackupLongTermRetentionPolicy extends models['ProxyResource'] { name: 'String' } }, - location: { + weeklyRetention: { required: false, - readOnly: true, - serializedName: 'location', + serializedName: 'properties.weeklyRetention', type: { name: 'String' } }, - state: { - required: true, - serializedName: 'properties.state', + monthlyRetention: { + required: false, + serializedName: 'properties.monthlyRetention', type: { - name: 'Enum', - allowedValues: [ 'Disabled', 'Enabled' ] + name: 'String' } }, - recoveryServicesBackupPolicyResourceId: { - required: true, - serializedName: 'properties.recoveryServicesBackupPolicyResourceId', + yearlyRetention: { + required: false, + serializedName: 'properties.yearlyRetention', type: { name: 'String' } + }, + weekOfYear: { + required: false, + serializedName: 'properties.weekOfYear', + type: { + name: 'Number' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js b/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js new file mode 100644 index 0000000000..da8769ff34 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/createDatabaseRestorePointDefinition.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the information necessary to perform a create database restore + * point operation. + * + */ +class CreateDatabaseRestorePointDefinition { + /** + * Create a CreateDatabaseRestorePointDefinition. + * @member {string} restorePointLabel The restore point label to apply + */ + constructor() { + } + + /** + * Defines the metadata of CreateDatabaseRestorePointDefinition + * + * @returns {object} metadata of CreateDatabaseRestorePointDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'CreateDatabaseRestorePointDefinition', + type: { + name: 'Composite', + className: 'CreateDatabaseRestorePointDefinition', + modelProperties: { + restorePointLabel: { + required: true, + serializedName: 'restorePointLabel', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CreateDatabaseRestorePointDefinition; diff --git a/lib/services/sqlManagement2/lib/models/database.js b/lib/services/sqlManagement2/lib/models/database.js index f343877aa3..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,90 +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.". Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is - * in the process of being applied to the database. Once successfully - * updated, it will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the - * database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * 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. */ constructor() { super(); @@ -213,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, @@ -221,216 +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: 'DateTime' + } + }, + recoveryServicesRecoveryPointId: { + required: false, + 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' } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js b/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js new file mode 100644 index 0000000000..c8e4237526 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/databaseAutomaticTuning.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Database-level Automatic Tuning. + * + * @extends models['ProxyResource'] + */ +class DatabaseAutomaticTuning extends models['ProxyResource'] { + /** + * Create a DatabaseAutomaticTuning. + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DatabaseAutomaticTuning + * + * @returns {object} metadata of DatabaseAutomaticTuning + * + */ + mapper() { + return { + required: false, + serializedName: 'DatabaseAutomaticTuning', + type: { + name: 'Composite', + className: 'DatabaseAutomaticTuning', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + desiredState: { + required: false, + serializedName: 'properties.desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Inherit', 'Custom', 'Auto', 'Unspecified' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'properties.actualState', + type: { + name: 'Enum', + allowedValues: [ 'Inherit', 'Custom', 'Auto', 'Unspecified' ] + } + }, + options: { + required: false, + serializedName: 'properties.options', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AutomaticTuningOptionsElementType', + type: { + name: 'Composite', + className: 'AutomaticTuningOptions' + } + } + } + } + } + } + }; + } +} + +module.exports = DatabaseAutomaticTuning; diff --git a/lib/services/sqlManagement2/lib/models/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/databaseOperation.js b/lib/services/sqlManagement2/lib/models/databaseOperation.js index 5adb38425c..f38745c1c9 100644 --- a/lib/services/sqlManagement2/lib/models/databaseOperation.js +++ b/lib/services/sqlManagement2/lib/models/databaseOperation.js @@ -35,6 +35,10 @@ class DatabaseOperation extends models['ProxyResource'] { * @member {string} [errorDescription] The operation error description. * @member {number} [errorSeverity] The operation error severity. * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. */ constructor() { super(); @@ -165,6 +169,30 @@ class DatabaseOperation extends models['ProxyResource'] { type: { name: 'Boolean' } + }, + estimatedCompletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.estimatedCompletionTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + isCancellable: { + required: false, + readOnly: true, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/sqlManagement2/lib/models/databaseUpdate.js b/lib/services/sqlManagement2/lib/models/databaseUpdate.js index 6fbeb24f88..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,93 +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.". Possible - * values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is - * in the process of being applied to the database. Once successfully - * updated, it will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of - * serviceLevelObjective property. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible - * values include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', - * 'P6', 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level - * objective of the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the - * database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. + * 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(); } /** @@ -167,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' } @@ -244,177 +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: { + defaultSecondaryLocation: { required: false, - serializedName: 'properties.restorePointInTime', + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', type: { - name: 'DateTime' + name: 'String' } }, - recoveryServicesRecoveryPointResourceId: { + failoverGroupId: { required: false, - serializedName: 'properties.recoveryServicesRecoveryPointResourceId', + readOnly: true, + serializedName: 'properties.failoverGroupId', type: { name: 'String' } }, - edition: { + restorePointInTime: { required: false, - serializedName: 'properties.edition', + serializedName: 'properties.restorePointInTime', type: { - name: 'String' + name: 'DateTime' } }, - maxSizeBytes: { + sourceDatabaseDeletionDate: { required: false, - serializedName: 'properties.maxSizeBytes', + serializedName: 'properties.sourceDatabaseDeletionDate', type: { - name: 'String' + name: 'DateTime' } }, - requestedServiceObjectiveId: { + recoveryServicesRecoveryPointId: { required: false, - serializedName: 'properties.requestedServiceObjectiveId', + serializedName: 'properties.recoveryServicesRecoveryPointId', type: { name: 'String' } }, - requestedServiceObjectiveName: { + longTermRetentionBackupResourceId: { required: false, - serializedName: 'properties.requestedServiceObjectiveName', + serializedName: 'properties.longTermRetentionBackupResourceId', type: { name: 'String' } }, - serviceLevelObjective: { + recoverableDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.serviceLevelObjective', + serializedName: 'properties.recoverableDatabaseId', type: { name: 'String' } }, - status: { + restorableDroppedDatabaseId: { required: false, - readOnly: true, - serializedName: 'properties.status', + serializedName: 'properties.restorableDroppedDatabaseId', type: { name: 'String' } }, - elasticPoolName: { + catalogCollation: { required: false, - serializedName: 'properties.elasticPoolName', + serializedName: 'properties.catalogCollation', type: { name: 'String' } }, - defaultSecondaryLocation: { + zoneRedundant: { required: false, - readOnly: true, - serializedName: 'properties.defaultSecondaryLocation', + serializedName: 'properties.zoneRedundant', type: { - name: 'String' + name: 'Boolean' } }, - serviceTierAdvisors: { + licenseType: { required: false, - readOnly: true, - serializedName: 'properties.serviceTierAdvisors', + serializedName: 'properties.licenseType', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ServiceTierAdvisorElementType', - type: { - name: 'Composite', - className: 'ServiceTierAdvisor' - } - } + name: 'String' } }, - transparentDataEncryption: { + maxLogSizeBytes: { required: false, readOnly: true, - serializedName: 'properties.transparentDataEncryption', + serializedName: 'properties.maxLogSizeBytes', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TransparentDataEncryptionElementType', - type: { - name: 'Composite', - className: 'TransparentDataEncryption' - } - } + name: 'Number' } }, - recommendedIndex: { + earliestRestoreDate: { required: false, readOnly: true, - serializedName: 'properties.recommendedIndex', + serializedName: 'properties.earliestRestoreDate', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'RecommendedIndexElementType', - type: { - name: 'Composite', - className: 'RecommendedIndex' - } - } + name: 'DateTime' } }, - failoverGroupId: { + readScale: { required: false, - readOnly: true, - serializedName: 'properties.failoverGroupId', + serializedName: 'properties.readScale', type: { name: 'String' } }, - readScale: { + currentSku: { required: false, - serializedName: 'properties.readScale', + readOnly: true, + serializedName: 'properties.currentSku', type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] + name: 'Composite', + className: 'Sku' } }, - sampleName: { + tags: { required: false, - serializedName: 'properties.sampleName', + serializedName: 'tags', type: { - name: 'String' + 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 c7454e9524..91c33a3d6d 100644 --- a/lib/services/sqlManagement2/lib/models/editionCapability.js +++ b/lib/services/sqlManagement2/lib/models/editionCapability.js @@ -13,17 +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() { } @@ -50,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, @@ -74,6 +69,30 @@ class EditionCapability { } } } + }, + zoneRedundant: { + required: false, + readOnly: true, + serializedName: 'zoneRedundant', + 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 f8179f7308..878e902fbf 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPool.js +++ b/lib/services/sqlManagement2/lib/models/elasticPool.js @@ -13,28 +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 {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(); @@ -99,61 +112,63 @@ 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: { + creationDate: { required: false, - serializedName: 'properties.dtu', + readOnly: true, + serializedName: 'properties.creationDate', type: { - name: 'Number' + name: 'DateTime' } }, - databaseDtuMax: { + maxSizeBytes: { required: false, - serializedName: 'properties.databaseDtuMax', + serializedName: 'properties.maxSizeBytes', type: { name: 'Number' } }, - databaseDtuMin: { + perDatabaseSettings: { required: false, - serializedName: 'properties.databaseDtuMin', + serializedName: 'properties.perDatabaseSettings', type: { - name: 'Number' + name: 'Composite', + className: 'ElasticPoolPerDatabaseSettings' } }, - storageMB: { + zoneRedundant: { required: false, - serializedName: 'properties.storageMB', + serializedName: 'properties.zoneRedundant', type: { - name: 'Number' + 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 7a4577b25b..8363d79a3f 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolEditionCapability.js @@ -13,17 +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() { } @@ -50,6 +54,30 @@ class ElasticPoolEditionCapability { name: 'String' } }, + supportedElasticPoolPerformanceLevels: { + required: false, + readOnly: true, + serializedName: 'supportedElasticPoolPerformanceLevels', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ElasticPoolPerformanceLevelCapabilityElementType', + type: { + name: 'Composite', + className: 'ElasticPoolPerformanceLevelCapability' + } + } + } + }, + zoneRedundant: { + required: false, + readOnly: true, + serializedName: 'zoneRedundant', + type: { + name: 'Boolean' + } + }, status: { required: false, readOnly: true, @@ -59,20 +87,11 @@ class ElasticPoolEditionCapability { allowedValues: [ 'Visible', 'Available', 'Default', 'Disabled' ] } }, - supportedElasticPoolDtus: { + reason: { required: false, - readOnly: true, - serializedName: 'supportedElasticPoolDtus', + serializedName: 'reason', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ElasticPoolDtuCapabilityElementType', - type: { - name: 'Composite', - className: 'ElasticPoolDtuCapability' - } - } + 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/elasticPoolOperation.js b/lib/services/sqlManagement2/lib/models/elasticPoolOperation.js new file mode 100644 index 0000000000..3a9d43357b --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolOperation.js @@ -0,0 +1,201 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A elastic pool operation. + * + * @extends models['ProxyResource'] + */ +class ElasticPoolOperation extends models['ProxyResource'] { + /** + * Create a ElasticPoolOperation. + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ElasticPoolOperation + * + * @returns {object} metadata of ElasticPoolOperation + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolOperation', + type: { + name: 'Composite', + className: 'ElasticPoolOperation', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + elasticPoolName: { + required: false, + readOnly: true, + serializedName: 'properties.elasticPoolName', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'properties.operation', + type: { + name: 'String' + } + }, + operationFriendlyName: { + required: false, + readOnly: true, + serializedName: 'properties.operationFriendlyName', + type: { + name: 'String' + } + }, + percentComplete: { + required: false, + readOnly: true, + serializedName: 'properties.percentComplete', + type: { + name: 'Number' + } + }, + serverName: { + required: false, + readOnly: true, + serializedName: 'properties.serverName', + type: { + name: 'String' + } + }, + startTime: { + required: false, + readOnly: true, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + errorCode: { + required: false, + readOnly: true, + serializedName: 'properties.errorCode', + type: { + name: 'Number' + } + }, + errorDescription: { + required: false, + readOnly: true, + serializedName: 'properties.errorDescription', + type: { + name: 'String' + } + }, + errorSeverity: { + required: false, + readOnly: true, + serializedName: 'properties.errorSeverity', + type: { + name: 'Number' + } + }, + isUserError: { + required: false, + readOnly: true, + serializedName: 'properties.isUserError', + type: { + name: 'Boolean' + } + }, + estimatedCompletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.estimatedCompletionTime', + type: { + name: 'DateTime' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + isCancellable: { + required: false, + readOnly: true, + serializedName: 'properties.isCancellable', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolOperation; diff --git a/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js b/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js new file mode 100644 index 0000000000..c389d12c01 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/elasticPoolOperationListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response to a list elastic pool operations request + */ +class ElasticPoolOperationListResult extends Array { + /** + * Create a ElasticPoolOperationListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ElasticPoolOperationListResult + * + * @returns {object} metadata of ElasticPoolOperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ElasticPoolOperationListResult', + type: { + name: 'Composite', + className: 'ElasticPoolOperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ElasticPoolOperationElementType', + type: { + name: 'Composite', + className: 'ElasticPoolOperation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ElasticPoolOperationListResult; diff --git a/lib/services/sqlManagement2/lib/models/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 8b1fbfa17b..5535097575 100644 --- a/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js +++ b/lib/services/sqlManagement2/lib/models/elasticPoolUpdate.js @@ -13,30 +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. */ constructor() { - super(); } /** @@ -53,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' } @@ -90,57 +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' - } } } } diff --git a/lib/services/sqlManagement2/lib/models/importRequest.js b/lib/services/sqlManagement2/lib/models/importRequest.js index a418f5129e..474fc662c8 100644 --- a/lib/services/sqlManagement2/lib/models/importRequest.js +++ b/lib/services/sqlManagement2/lib/models/importRequest.js @@ -23,11 +23,18 @@ class ImportRequest extends models['ExportRequest'] { * @member {string} databaseName The name of the database to import. * @member {string} edition The edition for the database being created. * Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * @member {string} serviceObjectiveName The name of the service objective to - * assign to the database. Possible values include: 'Basic', 'S0', 'S1', - * 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', + * 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', + * 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', + * 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', + * 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {string} maxSizeBytes The maximum size for the newly imported * database. */ diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index f39d5dc536..e291789c89 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -32,49 +32,6 @@ export interface Resource extends BaseResource { readonly type?: string; } -/** - * @class - * Initializes a new instance of the ProxyResource class. - * @constructor - * ARM proxy resource. - * - */ -export interface ProxyResource extends Resource { -} - -/** - * @class - * Initializes a new instance of the BackupLongTermRetentionPolicy class. - * @constructor - * A backup long term retention policy - * - * @member {string} [location] The geo-location where the resource lives - * @member {string} state The status of the backup long term retention policy. - * Possible values include: 'Disabled', 'Enabled' - * @member {string} recoveryServicesBackupPolicyResourceId The azure recovery - * services backup protection policy resource id - */ -export interface BackupLongTermRetentionPolicy extends ProxyResource { - readonly location?: string; - state: string; - recoveryServicesBackupPolicyResourceId: string; -} - -/** - * @class - * Initializes a new instance of the BackupLongTermRetentionVault class. - * @constructor - * A backup long term retention vault - * - * @member {string} [location] The geo-location where the resource lives - * @member {string} recoveryServicesVaultResourceId The azure recovery services - * vault resource id - */ -export interface BackupLongTermRetentionVault extends ProxyResource { - readonly location?: string; - recoveryServicesVaultResourceId: string; -} - /** * @class * Initializes a new instance of the TrackedResource class. @@ -91,22 +48,12 @@ export interface TrackedResource extends Resource { /** * @class - * Initializes a new instance of the RestorePoint class. + * Initializes a new instance of the ProxyResource class. * @constructor - * A database restore point. + * ARM proxy resource. * - * @member {string} [restorePointType] The restore point type of the database - * restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' - * @member {date} [restorePointCreationDate] Restore point creation time - * (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null - * otherwise. - * @member {date} [earliestRestoreDate] Earliest restore time (ISO8601 format). - * Populated when restorePointType = DISCRETE. Null otherwise. */ -export interface RestorePoint extends ProxyResource { - readonly restorePointType?: string; - readonly restorePointCreationDate?: Date; - readonly earliestRestoreDate?: Date; +export interface ProxyResource extends Resource { } /** @@ -163,202 +110,37 @@ export interface RestorableDroppedDatabase extends ProxyResource { /** * @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. - */ -export interface EditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedServiceLevelObjectives?: ServiceObjectiveCapability[]; -} - -/** - * @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. - */ -export interface ElasticPoolEditionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedElasticPoolDtus?: ElasticPoolDtuCapability[]; -} - -/** - * @class - * Initializes a new instance of the ServerVersionCapability class. + * Initializes a new instance of the CheckNameAvailabilityRequest class. * @constructor - * The server capabilities. + * A request to check whether the specified name for a resource is available. * - * @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} name The name whose availability is to be checked. */ -export interface ServerVersionCapability { - readonly name?: string; - readonly status?: string; - readonly supportedEditions?: EditionCapability[]; - readonly supportedElasticPoolEditions?: ElasticPoolEditionCapability[]; +export interface CheckNameAvailabilityRequest { + name: string; } /** * @class - * Initializes a new instance of the LocationCapabilities class. + * Initializes a new instance of the CheckNameAvailabilityResponse class. * @constructor - * The capabilities for a location. + * A response indicating whether the specified name for a resource is + * available. * - * @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 {boolean} [available] True if the name is available, otherwise + * false. + * @member {string} [message] A message explaining why the name is unavailable. + * Will be null if the name is available. + * @member {string} [name] The name whose availability was checked. + * @member {string} [reason] The reason code explaining why the name is + * unavailable. Will be null if the name is available. Possible values include: + * 'Invalid', 'AlreadyExists' */ -export interface LocationCapabilities { +export interface CheckNameAvailabilityResponse { + readonly available?: boolean; + readonly message?: string; readonly name?: string; - readonly status?: string; - readonly supportedServerVersions?: ServerVersionCapability[]; + readonly reason?: string; } /** @@ -647,11 +429,17 @@ export interface ExportRequest { * @member {string} databaseName The name of the database to import. * @member {string} edition The edition for the database being created. * Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', - * 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' * @member {string} serviceObjectiveName The name of the service objective to - * assign to the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', - * 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' + * assign to the database. Possible values include: 'System', 'System0', + * 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', + * 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', + * 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', 'DW10000c', + * 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', 'DS500', + * 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {string} maxSizeBytes The maximum size for the newly imported * database. */ @@ -768,6 +556,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?: TrackedResource[]; + readonly metrics?: RecommendedElasticPoolMetric[]; +} + /** * @class * Initializes a new instance of the ReplicationLink class. @@ -872,55 +717,187 @@ export interface ServiceObjective extends ProxyResource { /** * @class - * Initializes a new instance of the CheckNameAvailabilityRequest class. + * Initializes a new instance of the ElasticPoolActivity class. * @constructor - * A request to check whether the specified name for a resource is available. + * Represents the activity on an elastic pool. * - * @member {string} name The name whose availability is to be checked. - */ -export interface CheckNameAvailabilityRequest { - name: string; -} - -/** - * @class - * Initializes a new instance of the CheckNameAvailabilityResponse class. - * @constructor - * A response indicating whether the specified name for a resource is - * available. + * @member {string} [location] The geo-location where the resource lives + * @member {date} [endTime] The time the operation finished (ISO8601 format). + * @member {number} [errorCode] The error code if available. + * @member {string} [errorMessage] The error message if available. + * @member {number} [errorSeverity] The error severity if available. + * @member {string} [operation] The operation name. + * @member {uuid} [operationId] The unique operation ID. + * @member {number} [percentComplete] The percentage complete if available. + * @member {number} [requestedDatabaseDtuMax] The requested max DTU per + * database if available. + * @member {number} [requestedDatabaseDtuMin] The requested min DTU per + * database if available. + * @member {number} [requestedDtu] The requested DTU for the pool if available. + * @member {string} [requestedElasticPoolName] The requested name for the + * elastic pool if available. + * @member {number} [requestedStorageLimitInGB] The requested storage limit for + * the pool in GB if available. + * @member {string} [elasticPoolName] The name of the elastic pool. + * @member {string} [serverName] The name of the server the elastic pool is in. + * @member {date} [startTime] The time the operation started (ISO8601 format). + * @member {string} [state] The current state of the operation. + * @member {number} [requestedStorageLimitInMB] The requested storage limit in + * MB. + * @member {number} [requestedDatabaseDtuGuarantee] The requested per database + * DTU guarantee. + * @member {number} [requestedDatabaseDtuCap] The requested per database DTU + * cap. + * @member {number} [requestedDtuGuarantee] The requested DTU guarantee. + */ +export interface ElasticPoolActivity extends ProxyResource { + location?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; + readonly percentComplete?: number; + readonly requestedDatabaseDtuMax?: number; + readonly requestedDatabaseDtuMin?: number; + readonly requestedDtu?: number; + readonly requestedElasticPoolName?: string; + readonly requestedStorageLimitInGB?: number; + readonly elasticPoolName?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly requestedStorageLimitInMB?: number; + readonly requestedDatabaseDtuGuarantee?: number; + readonly requestedDatabaseDtuCap?: number; + readonly requestedDtuGuarantee?: number; +} + +/** + * @class + * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * @constructor + * Represents the activity on an elastic pool. * - * @member {boolean} [available] True if the name is available, otherwise - * false. - * @member {string} [message] A message explaining why the name is unavailable. - * Will be null if the name is available. - * @member {string} [name] The name whose availability was checked. - * @member {string} [reason] The reason code explaining why the name is - * unavailable. Will be null if the name is available. Possible values include: - * 'Invalid', 'AlreadyExists' + * @member {string} [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 CheckNameAvailabilityResponse { - readonly available?: boolean; - readonly message?: string; +export interface ElasticPoolDatabaseActivity extends ProxyResource { + location?: string; + readonly databaseName?: string; + readonly endTime?: Date; + readonly errorCode?: number; + readonly errorMessage?: string; + readonly errorSeverity?: number; + readonly operation?: string; + readonly operationId?: string; + readonly percentComplete?: number; + readonly requestedElasticPoolName?: string; + readonly currentElasticPoolName?: string; + readonly currentServiceObjective?: string; + readonly requestedServiceObjective?: string; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; +} + +/** + * @class + * Initializes a new instance of the OperationImpact class. + * @constructor + * The impact of an operation, both in absolute and relative terms. + * + * @member {string} [name] The name of the impact dimension. + * @member {string} [unit] The unit in which estimated impact to dimension is + * measured. + * @member {number} [changeValueAbsolute] The absolute impact to dimension. + * @member {number} [changeValueRelative] The relative impact to dimension + * (null if not applicable) + */ +export interface OperationImpact { readonly name?: string; - readonly reason?: string; + readonly unit?: string; + readonly changeValueAbsolute?: number; + readonly changeValueRelative?: number; } /** * @class - * Initializes a new instance of the RecommendedElasticPoolMetric class. + * Initializes a new instance of the RecommendedIndex class. * @constructor - * Represents recommended elastic pool metric. + * Represents a database recommended index. * - * @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} [action] The proposed index action. You can create a + * missing index, drop an unused index, or rebuild an existing index to improve + * its performance. Possible values include: 'Create', 'Drop', 'Rebuild' + * @member {string} [state] The current recommendation state. Possible values + * include: 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', + * 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' + * @member {date} [created] The UTC datetime showing when this resource was + * created (ISO8601 format). + * @member {date} [lastModified] The UTC datetime of when was this resource + * last changed (ISO8601 format). + * @member {string} [indexType] The type of index (CLUSTERED, NONCLUSTERED, + * COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', + * 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' + * @member {string} [schema] The schema where table to build index over resides + * @member {string} [table] The table on which to build index. + * @member {array} [columns] Columns over which to build index + * @member {array} [includedColumns] The list of column names to be included in + * the index + * @member {string} [indexScript] The full build index script + * @member {array} [estimatedImpact] The estimated impact of doing recommended + * index action. + * @member {array} [reportedImpact] The values reported after index action is + * complete. */ -export interface RecommendedElasticPoolMetric { - dateTime?: Date; - dtu?: number; - sizeGB?: number; +export interface RecommendedIndex extends ProxyResource { + readonly action?: string; + readonly state?: string; + readonly created?: Date; + readonly lastModified?: Date; + readonly indexType?: string; + readonly schema?: string; + readonly table?: string; + readonly columns?: string[]; + readonly includedColumns?: string[]; + readonly indexScript?: string; + readonly estimatedImpact?: OperationImpact[]; + readonly reportedImpact?: OperationImpact[]; +} + +/** + * @class + * Initializes a new instance of the TransparentDataEncryption class. + * @constructor + * Represents a database transparent data encryption configuration. + * + * @member {string} [location] Resource location. + * @member {string} [status] The status of the database transparent data + * encryption. Possible values include: 'Enabled', 'Disabled' + */ +export interface TransparentDataEncryption extends ProxyResource { + readonly location?: string; + status?: string; } /** @@ -930,9 +907,15 @@ export interface RecommendedElasticPoolMetric { * A Slo Usage Metric. * * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' + * 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 @@ -1015,1387 +998,1892 @@ export interface ServiceTierAdvisor extends ProxyResource { /** * @class - * Initializes a new instance of the TransparentDataEncryption class. + * Initializes a new instance of the TransparentDataEncryptionActivity class. * @constructor - * Represents a database transparent data encryption configuration. + * Represents a database transparent data encryption Scan. * * @member {string} [location] Resource location. - * @member {string} [status] The status of the database transparent data - * encryption. Possible values include: 'Enabled', 'Disabled' + * @member {string} [status] The status of the database. Possible values + * include: 'Encrypting', 'Decrypting' + * @member {number} [percentComplete] The percent complete of the transparent + * data encryption scan for a database. */ -export interface TransparentDataEncryption extends ProxyResource { +export interface TransparentDataEncryptionActivity extends ProxyResource { readonly location?: string; - status?: string; + readonly status?: string; + readonly percentComplete?: number; } /** * @class - * Initializes a new instance of the OperationImpact class. + * Initializes a new instance of the ServerUsage class. * @constructor - * The impact of an operation, both in absolute and relative terms. + * Represents server metrics. * - * @member {string} [name] The name of the impact dimension. - * @member {string} [unit] The unit in which estimated impact to dimension is - * measured. - * @member {number} [changeValueAbsolute] The absolute impact to dimension. - * @member {number} [changeValueRelative] The relative impact to dimension - * (null if not applicable) + * @member {string} [name] 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 OperationImpact { +export interface ServerUsage { readonly name?: string; + readonly resourceName?: string; + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; readonly unit?: string; - readonly changeValueAbsolute?: number; - readonly changeValueRelative?: number; + readonly nextResetTime?: Date; } /** * @class - * Initializes a new instance of the RecommendedIndex class. + * Initializes a new instance of the DatabaseUsage class. * @constructor - * Represents a database recommended index. + * The database usages. * - * @member {string} [action] The proposed index action. You can create a - * missing index, drop an unused index, or rebuild an existing index to improve - * its performance. Possible values include: 'Create', 'Drop', 'Rebuild' - * @member {string} [state] The current recommendation state. Possible values - * include: 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', - * 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - * @member {date} [created] The UTC datetime showing when this resource was - * created (ISO8601 format). - * @member {date} [lastModified] The UTC datetime of when was this resource - * last changed (ISO8601 format). - * @member {string} [indexType] The type of index (CLUSTERED, NONCLUSTERED, - * COLUMNSTORE, CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', - * 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' - * @member {string} [schema] The schema where table to build index over resides - * @member {string} [table] The table on which to build index. - * @member {array} [columns] Columns over which to build index - * @member {array} [includedColumns] The list of column names to be included in - * the index - * @member {string} [indexScript] The full build index script - * @member {array} [estimatedImpact] The estimated impact of doing recommended - * index action. - * @member {array} [reportedImpact] The values reported after index action is - * complete. + * @member {string} [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 RecommendedIndex extends ProxyResource { - readonly action?: string; - readonly state?: string; - readonly created?: Date; - readonly lastModified?: Date; - readonly indexType?: string; - readonly schema?: string; - readonly table?: string; - readonly columns?: string[]; - readonly includedColumns?: string[]; - readonly indexScript?: string; - readonly estimatedImpact?: OperationImpact[]; - readonly reportedImpact?: OperationImpact[]; +export interface 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 Database class. + * Initializes a new instance of the DatabaseBlobAuditingPolicy class. * @constructor - * Represents a database. - * - * @member {string} [kind] Kind of database. This is metadata used for the - * Azure portal experience. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * A database blob auditing policy. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible + * @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} [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} [storageEndpoint] Specifies the blob storage endpoint (e.g. + * https://MyAccount.blob.core.windows.net). If state is Enabled, + * storageEndpoint is required. + * @member {string} [storageAccountAccessKey] Specifies the identifier key of + * the auditing storage account. If state is Enabled, storageAccountAccessKey + * is required. + * @member {number} [retentionDays] Specifies the number of days to keep in the + * audit logs. + * @member {array} [auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * @member {uuid} [storageAccountSubscriptionId] Specifies the blob storage + * subscription Id. + * @member {boolean} [isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. */ -export interface Database extends TrackedResource { +export interface DatabaseBlobAuditingPolicy extends ProxyResource { readonly kind?: string; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; + state: string; + storageEndpoint?: string; + storageAccountAccessKey?: string; + retentionDays?: number; + auditActionsAndGroups?: string[]; + storageAccountSubscriptionId?: string; + isStorageSecondaryKeyInUse?: boolean; } /** * @class - * Initializes a new instance of the RecommendedElasticPool class. + * Initializes a new instance of the AutomaticTuningOptions class. * @constructor - * Represents a recommented elastic pool. + * Automatic tuning properties for individual advisors. * - * @member {string} [databaseEdition] The edition of the recommended elastic - * pool. The ElasticPoolEdition enumeration contains all the valid editions. - * Possible values include: 'Basic', 'Standard', 'Premium' - * @member {number} [dtu] The DTU for the recommended elastic pool. - * @member {number} [databaseDtuMin] The minimum DTU for the database. - * @member {number} [databaseDtuMax] The maximum DTU for the database. - * @member {number} [storageMB] Gets storage size in megabytes. - * @member {date} [observationPeriodStart] The observation period start - * (ISO8601 format). - * @member {date} [observationPeriodEnd] The observation period start (ISO8601 - * format). - * @member {number} [maxObservedDtu] Gets maximum observed DTU. - * @member {number} [maxObservedStorageMB] Gets maximum observed storage in - * megabytes. - * @member {array} [databases] The list of databases in this pool. Expanded - * property - * @member {array} [metrics] The list of databases housed in the server. - * Expanded property + * @member {string} [desiredState] Automatic tuning option desired state. + * Possible values include: 'Off', 'On', 'Default' + * @member {string} [actualState] Automatic tuning option actual state. + * Possible values include: 'Off', 'On' + * @member {number} [reasonCode] Reason code if desired and actual state are + * different. + * @member {string} [reasonDesc] Reason description if desired and actual state + * are different. Possible values include: 'Default', 'Disabled', + * 'AutoConfigured', 'InheritedFromServer', 'QueryStoreOff', + * 'QueryStoreReadOnly', 'NotSupported' */ -export interface RecommendedElasticPool extends ProxyResource { - readonly databaseEdition?: string; - dtu?: number; - databaseDtuMin?: number; - databaseDtuMax?: number; - storageMB?: number; - readonly observationPeriodStart?: Date; - readonly observationPeriodEnd?: Date; - readonly maxObservedDtu?: number; - readonly maxObservedStorageMB?: number; - readonly databases?: Database[]; - readonly metrics?: RecommendedElasticPoolMetric[]; +export interface AutomaticTuningOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the 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 {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; - 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 {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; +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 ElasticPoolActivity class. + * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. * @constructor - * Represents the activity on an elastic pool. + * Read-write endpoint of the failover group instance. * - * @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} 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 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 FailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; } /** * @class - * Initializes a new instance of the ElasticPoolDatabaseActivity class. + * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. * @constructor - * Represents the activity on an elastic pool. + * Read-only endpoint of the failover group instance. * - * @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} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' */ -export interface ElasticPoolDatabaseActivity extends ProxyResource { - location?: string; - readonly databaseName?: string; - readonly endTime?: Date; - readonly errorCode?: number; - readonly errorMessage?: string; - readonly errorSeverity?: number; +export interface FailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; +} + +/** + * @class + * Initializes a new instance of the PartnerInfo class. + * @constructor + * Partner server information for the failover group. + * + * @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 PartnerInfo { + id: string; + readonly location?: string; + readonly replicationRole?: string; +} + +/** + * @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 FailoverGroup extends ProxyResource { + readonly location?: string; + tags?: { [propertyName: string]: string }; + readWriteEndpoint: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + readonly replicationRole?: string; + readonly replicationState?: string; + partnerServers: PartnerInfo[]; + databases?: string[]; +} + +/** + * @class + * Initializes a new instance of the FailoverGroupUpdate class. + * @constructor + * A failover group update request. + * + * @member {object} [readWriteEndpoint] Read-write endpoint of the failover + * group instance. + * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the + * read-write endpoint for the failover group. If failoverPolicy is Automatic + * then failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] + * Grace period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group + * instance. + * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the + * read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * @member {array} [databases] List of databases in the failover group. + * @member {object} [tags] Resource tags. + */ +export interface FailoverGroupUpdate { + readWriteEndpoint?: FailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; + databases?: string[]; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the OperationDisplay class. + * @constructor + * Display metadata associated with the operation. + * + * @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 OperationDisplay { + readonly provider?: string; + readonly resource?: string; 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 description?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * SQL REST API operation definition. + * + * @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 Operation { + readonly name?: string; + readonly display?: OperationDisplay; + readonly origin?: string; + readonly properties?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the ServerKey class. + * @constructor + * A server key. + * + * @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 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 ResourceIdentity class. + * @constructor + * Azure Active Directory identity configuration for a resource. + * + * @member {uuid} [principalId] The Azure Active Directory principal id. + * @member {string} [type] The identity type. Set this to 'SystemAssigned' in + * order to automatically create and assign an Azure Active Directory principal + * for the resource. Possible values include: 'SystemAssigned' + * @member {uuid} [tenantId] The Azure Active Directory tenant id. + */ +export interface ResourceIdentity { + readonly principalId?: string; + type?: string; + readonly tenantId?: string; +} + +/** + * @class + * Initializes a new instance of the Server class. + * @constructor + * An Azure SQL Database server. + * + * @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 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 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. + */ +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 SyncAgent class. + * @constructor + * An Azure SQL Database sync agent. + * + * @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 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 SyncAgentKeyProperties class. + * @constructor + * Properties of an Azure SQL Database sync agent key. + * + * @member {string} [syncAgentKey] Key of sync agent. + */ +export interface SyncAgentKeyProperties { + readonly syncAgentKey?: string; +} + +/** + * @class + * Initializes a new instance of the SyncAgentLinkedDatabase class. + * @constructor + * An Azure SQL Database sync agent linked database. + * + * @member {string} [databaseType] Type of the sync agent linked database. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @member {string} [databaseId] Id of the sync agent linked database. + * @member {string} [description] Description of the sync agent linked + * database. + * @member {string} [serverName] Server name of the sync agent linked database. + * @member {string} [databaseName] Database name of the sync agent linked + * database. + * @member {string} [userName] User name of the sync agent linked database. + */ +export interface 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 SyncDatabaseIdProperties class. + * @constructor + * Properties of the sync database id. + * + * @member {string} [id] ARM resource id of sync database. + */ +export interface SyncDatabaseIdProperties { + readonly id?: string; +} + +/** + * @class + * Initializes a new instance of the SyncFullSchemaTableColumn class. + * @constructor + * Properties of the column in the table of database full schema. + * + * @member {string} [dataSize] Data size of the column. + * @member {string} [dataType] Data type of the column. + * @member {string} [errorId] Error id of the column. + * @member {boolean} [hasError] If there is error in the table. + * @member {boolean} [isPrimaryKey] If it is the primary key of the table. + * @member {string} [name] Name of the column. + * @member {string} [quotedName] Quoted name of the column. + */ +export interface SyncFullSchemaTableColumn { + readonly dataSize?: string; + readonly dataType?: string; + readonly errorId?: string; + readonly hasError?: boolean; + readonly isPrimaryKey?: boolean; + readonly name?: string; + readonly quotedName?: string; +} + +/** + * @class + * Initializes a new instance of the SyncFullSchemaTable class. + * @constructor + * Properties of the table in the database full schema. + * + * @member {array} [columns] List of columns in the table of database full + * schema. + * @member {string} [errorId] Error id of the table. + * @member {boolean} [hasError] If there is error in the table. + * @member {string} [name] Name of the table. + * @member {string} [quotedName] Quoted name of the table. + */ +export interface SyncFullSchemaTable { + readonly columns?: SyncFullSchemaTableColumn[]; + readonly errorId?: string; + readonly hasError?: boolean; + readonly name?: string; + readonly quotedName?: string; +} + +/** + * @class + * Initializes a new instance of the SyncFullSchemaProperties class. + * @constructor + * 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 SyncGroupLogProperties class. + * @constructor + * Properties of an Azure SQL Database sync group log. + * + * @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 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 SyncGroupSchemaTableColumn class. + * @constructor + * Properties of column in sync group table. + * + * @member {string} [quotedName] Quoted name of sync group table column. + * @member {string} [dataSize] Data size of the column. + * @member {string} [dataType] Data type of the column. + */ +export interface SyncGroupSchemaTableColumn { + quotedName?: string; + dataSize?: string; + dataType?: string; +} + +/** + * @class + * Initializes a new instance of the SyncGroupSchemaTable class. + * @constructor + * Properties of table in sync group schema. + * + * @member {array} [columns] List of columns in sync group schema. + * @member {string} [quotedName] Quoted name of sync group schema table. + */ +export interface SyncGroupSchemaTable { + columns?: SyncGroupSchemaTableColumn[]; + quotedName?: string; +} + +/** + * @class + * Initializes a new instance of the SyncGroupSchema class. + * @constructor + * Properties of sync group schema. + * + * @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 SyncGroupSchema { + tables?: SyncGroupSchemaTable[]; + masterSyncMemberName?: string; +} + +/** + * @class + * Initializes a new instance of the SyncGroup class. + * @constructor + * An Azure SQL Database sync group. + * + * @member {number} [interval] Sync interval of the sync group. + * @member {date} [lastSyncTime] Last sync time of the sync group. + * @member {string} [conflictResolutionPolicy] Conflict resolution policy of + * the sync group. Possible values include: 'HubWin', 'MemberWin' + * @member {string} [syncDatabaseId] ARM resource id of the sync database in + * the sync group. + * @member {string} [hubDatabaseUserName] User name for the sync group hub + * database credential. + * @member {string} [hubDatabasePassword] Password for the sync group hub + * database credential. + * @member {string} [syncState] Sync state of the sync group. Possible values + * include: 'NotReady', 'Error', 'Warning', 'Progressing', 'Good' + * @member {object} [schema] Sync schema of the sync group. + * @member {array} [schema.tables] List of tables in sync group schema. + * @member {string} [schema.masterSyncMemberName] Name of master sync member + * where the schema is from. + */ +export interface SyncGroup extends ProxyResource { + interval?: number; + readonly lastSyncTime?: Date; + conflictResolutionPolicy?: string; + syncDatabaseId?: string; + hubDatabaseUserName?: string; + hubDatabasePassword?: string; + readonly syncState?: string; + schema?: SyncGroupSchema; +} + +/** + * @class + * Initializes a new instance of the SyncMember class. + * @constructor + * An Azure SQL Database sync member. + * + * @member {string} [databaseType] Database type of the sync member. Possible + * values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @member {string} [syncAgentId] ARM resource id of the sync agent in the sync + * member. + * @member {uuid} [sqlServerDatabaseId] SQL Server database id of the sync + * member. + * @member {string} [serverName] Server name of the member database in the sync + * member + * @member {string} [databaseName] Database name of the member database in the + * sync member. + * @member {string} [userName] User name of the member database in the sync + * member. + * @member {string} [password] Password of the member database in the sync + * member. + * @member {string} [syncDirection] Sync direction of the sync member. Possible + * values include: 'Bidirectional', 'OneWayMemberToHub', 'OneWayHubToMember' + * @member {string} [syncState] Sync state of the sync member. Possible values + * include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed', + * 'DisabledTombstoneCleanup', 'DisabledBackupRestore', + * 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled', + * 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed', + * 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning', + * 'ReprovisionFailed', 'UnReprovisioned' + */ +export interface SyncMember extends ProxyResource { + databaseType?: string; + syncAgentId?: string; + sqlServerDatabaseId?: string; + serverName?: string; + databaseName?: string; + userName?: string; + password?: string; + syncDirection?: string; + readonly syncState?: string; +} + +/** + * @class + * Initializes a new instance of the SubscriptionUsage class. + * @constructor + * Usage Metric of a Subscription in a Location. + * + * @member {string} [displayName] User-readable name of the metric. + * @member {number} [currentValue] Current value of the metric. + * @member {number} [limit] Boundary value of the metric. + * @member {string} [unit] Unit of the metric. + */ +export interface SubscriptionUsage extends ProxyResource { + readonly displayName?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly unit?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkRule class. + * @constructor + * A virtual network rule. + * + * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual + * network subnet. + * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule + * before the virtual network has vnet service endpoint enabled. + * @member {string} [state] Virtual Network Rule State. Possible values + * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + */ +export interface VirtualNetworkRule extends ProxyResource { + virtualNetworkSubnetId: string; + ignoreMissingVnetServiceEndpoint?: boolean; readonly state?: string; } /** * @class - * Initializes a new instance of the DatabaseUpdate class. + * Initializes a new instance of the LongTermRetentionBackup class. * @constructor - * Represents a database update. - * - * @member {object} [tags] Resource tags. - * @member {string} [collation] The collation of the database. If createMode is - * not Default, this value is ignored. - * @member {date} [creationDate] The creation date of the database (ISO8601 - * format). - * @member {number} [containmentState] The containment state of the database. - * @member {uuid} [currentServiceObjectiveId] The current service level - * objective ID of the database. This is the ID of the service level objective - * that is currently active. - * @member {uuid} [databaseId] The ID of the database. - * @member {date} [earliestRestoreDate] This records the earliest start date - * and time that restore is available for this database (ISO8601 format). - * @member {string} [createMode] Specifies the mode of database creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * A long term retention backup. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @member {string} [serverName] The server name that the backup database + * belong to. + * @member {date} [serverCreateTime] The create time of the server. + * @member {string} [databaseName] The name of the database the backup belong + * to + * @member {date} [databaseDeletionTime] The delete time of the database + * @member {date} [backupTime] The time the backup was taken + * @member {date} [backupExpirationTime] The time the long term retention + * backup will expire. + */ +export interface LongTermRetentionBackup extends ProxyResource { + readonly serverName?: string; + readonly serverCreateTime?: Date; + readonly databaseName?: string; + readonly databaseDeletionTime?: Date; + readonly backupTime?: Date; + readonly backupExpirationTime?: Date; +} + +/** + * @class + * Initializes a new instance of the BackupLongTermRetentionPolicy class. + * @constructor + * A long term retention policy. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * @member {string} [sourceDatabaseId] Conditional. If createMode is Copy, - * NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or - * Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * @member {date} [sourceDatabaseDeletionDate] Conditional. If createMode is - * Restore and sourceDatabaseId is the deleted database's original resource id - * when it existed (as opposed to its current restorable dropped database id), - * then this value is required. Specifies the time that the database was - * deleted. - * @member {date} [restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * @member {string} [recoveryServicesRecoveryPointResourceId] Conditional. If - * createMode is RestoreLongTermRetentionBackup, then this value is required. - * Specifies the resource ID of the recovery point to restore from. - * @member {string} [edition] The edition of the database. The DatabaseEditions - * enumeration contains all the valid editions. If createMode is - * NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * @member {string} [maxSizeBytes] The max size of the database expressed in - * bytes. If createMode is not Default, this value is ignored. To see possible - * values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {uuid} [requestedServiceObjectiveId] The configured service level - * objective ID of the database. This is the service level objective that is in - * the process of being applied to the database. Once successfully updated, it - * will match the value of currentServiceObjectiveId property. If - * requestedServiceObjectiveId and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveId overrides the value of - * requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * @member {string} [requestedServiceObjectiveName] The name of the configured - * service level objective of the database. This is the service level objective - * that is in the process of being applied to the database. Once successfully - * updated, it will match the value of serviceLevelObjective property. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * @member {string} [serviceLevelObjective] The current service level objective - * of the database. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' - * @member {string} [status] The status of the database. - * @member {string} [elasticPoolName] The name of the elastic pool the database - * is in. If elasticPoolName and requestedServiceObjectiveName are both - * updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * @member {string} [defaultSecondaryLocation] The default secondary region for - * this database. - * @member {array} [serviceTierAdvisors] The list of service tier advisors for - * this database. Expanded property - * @member {array} [transparentDataEncryption] The transparent data encryption - * info for this database. - * @member {array} [recommendedIndex] The recommended indices for this - * database. - * @member {string} [failoverGroupId] The resource identifier of the failover - * group containing this database. - * @member {string} [readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} [sampleName] Indicates the name of the sample schema to - * apply when creating this database. If createMode is not Default, this value - * is ignored. Not supported for DataWarehouse edition. Possible values - * include: 'AdventureWorksLT' + * @member {string} [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 DatabaseUpdate extends Resource { - tags?: { [propertyName: string]: string }; - collation?: string; - readonly creationDate?: Date; - readonly containmentState?: number; - readonly currentServiceObjectiveId?: string; - readonly databaseId?: string; - readonly earliestRestoreDate?: Date; - createMode?: string; - sourceDatabaseId?: string; - sourceDatabaseDeletionDate?: Date; - restorePointInTime?: Date; - recoveryServicesRecoveryPointResourceId?: string; - edition?: string; - maxSizeBytes?: string; - requestedServiceObjectiveId?: string; - requestedServiceObjectiveName?: string; - readonly serviceLevelObjective?: string; - readonly status?: string; - elasticPoolName?: string; - readonly defaultSecondaryLocation?: string; - readonly serviceTierAdvisors?: ServiceTierAdvisor[]; - readonly transparentDataEncryption?: TransparentDataEncryption[]; - readonly recommendedIndex?: RecommendedIndex[]; - readonly failoverGroupId?: string; - readScale?: string; - sampleName?: string; +export interface BackupLongTermRetentionPolicy extends ProxyResource { + weeklyRetention?: string; + monthlyRetention?: string; + yearlyRetention?: string; + weekOfYear?: number; } /** * @class - * Initializes a new instance of the TransparentDataEncryptionActivity class. + * Initializes a new instance of the AutomaticTuningServerOptions class. * @constructor - * Represents a database transparent data encryption Scan. + * Automatic tuning properties for individual advisors. * - * @member {string} [location] Resource location. - * @member {string} [status] The status of the database. Possible values - * include: 'Encrypting', 'Decrypting' - * @member {number} [percentComplete] The percent complete of the transparent - * data encryption scan for a database. + * @member {string} [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 TransparentDataEncryptionActivity extends ProxyResource { - readonly location?: string; - readonly status?: string; - readonly percentComplete?: number; +export interface AutomaticTuningServerOptions { + desiredState?: string; + readonly actualState?: string; + readonly reasonCode?: number; + readonly reasonDesc?: string; } /** * @class - * Initializes a new instance of the ServerUsage class. + * Initializes a new instance of the ServerAutomaticTuning class. * @constructor - * Represents server metrics. + * Server-level Automatic Tuning. * - * @member {string} [name] Name of the server usage metric. - * @member {string} [resourceName] The name of the resource. - * @member {string} [displayName] The metric display name. - * @member {number} [currentValue] The current value of the metric. - * @member {number} [limit] The current limit of the metric. - * @member {string} [unit] The units of the metric. - * @member {date} [nextResetTime] The next reset time for the metric (ISO8601 - * format). + * @member {string} [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 ServerUsage { - readonly name?: string; - readonly resourceName?: string; - readonly displayName?: string; - readonly currentValue?: number; - readonly limit?: number; - readonly unit?: string; - readonly nextResetTime?: Date; +export interface ServerAutomaticTuning extends ProxyResource { + desiredState?: string; + readonly actualState?: string; + options?: { [propertyName: string]: AutomaticTuningServerOptions }; } /** * @class - * Initializes a new instance of the DatabaseUsage class. + * Initializes a new instance of the ServerDnsAlias class. * @constructor - * The database usages. + * A server DNS alias. * - * @member {string} [name] The name of the usage metric. - * @member {string} [resourceName] The name of the resource. - * @member {string} [displayName] The usage metric display name. - * @member {number} [currentValue] The current value of the usage metric. - * @member {number} [limit] The current limit of the usage metric. - * @member {string} [unit] The units of the usage metric. - * @member {date} [nextResetTime] The next reset time for the usage metric - * (ISO8601 format). + * @member {string} [azureDnsRecord] The fully qualified DNS record for alias */ -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 ServerDnsAlias extends ProxyResource { + readonly azureDnsRecord?: string; } /** * @class - * Initializes a new instance of the DatabaseBlobAuditingPolicy class. + * Initializes a new instance of the ServerDnsAliasAcquisition class. * @constructor - * A database blob auditing policy. + * A server DNS alias acquisition request. * - * @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} [oldServerDnsAliasId] The id of the server alias that will + * be acquired to point to this server instead. */ -export interface DatabaseBlobAuditingPolicy extends ProxyResource { - readonly kind?: string; - state: string; - storageEndpoint?: string; - storageAccountAccessKey?: string; - retentionDays?: number; - auditActionsAndGroups?: string[]; - storageAccountSubscriptionId?: string; - isStorageSecondaryKeyInUse?: boolean; +export interface ServerDnsAliasAcquisition { + oldServerDnsAliasId?: string; } /** * @class - * Initializes a new instance of the EncryptionProtector class. + * Initializes a new instance of the RestorePoint class. * @constructor - * The server encryption protector. + * Database restore points. * - * @member {string} [kind] Kind of encryption protector. This is metadata used - * for the Azure portal experience. * @member {string} [location] Resource location. - * @member {string} [subregion] Subregion of the encryption protector. - * @member {string} [serverKeyName] The name of the server key. - * @member {string} serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' - * @member {string} [uri] The URI of the server key. - * @member {string} [thumbprint] Thumbprint of the server key. + * @member {string} [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 EncryptionProtector extends ProxyResource { - kind?: string; +export interface RestorePoint extends ProxyResource { readonly location?: string; - readonly subregion?: string; - serverKeyName?: string; - serverKeyType: string; - readonly uri?: string; - readonly thumbprint?: string; + readonly restorePointType?: string; + readonly earliestRestoreDate?: Date; + readonly restorePointCreationDate?: Date; + readonly restorePointLabel?: string; } /** * @class - * Initializes a new instance of the FailoverGroupReadWriteEndpoint class. + * Initializes a new instance of the CreateDatabaseRestorePointDefinition class. * @constructor - * Read-write endpoint of the failover group instance. + * Contains the information necessary to perform a create database restore + * point operation. * - * @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} restorePointLabel The restore point label to apply */ -export interface FailoverGroupReadWriteEndpoint { - failoverPolicy: string; - failoverWithDataLossGracePeriodMinutes?: number; +export interface CreateDatabaseRestorePointDefinition { + restorePointLabel: string; } /** * @class - * Initializes a new instance of the FailoverGroupReadOnlyEndpoint class. + * Initializes a new instance of the DatabaseOperation class. * @constructor - * Read-only endpoint of the failover group instance. + * A database operation. * - * @member {string} [failoverPolicy] Failover policy of the read-only endpoint - * for the failover group. Possible values include: 'Disabled', 'Enabled' + * @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 FailoverGroupReadOnlyEndpoint { - failoverPolicy?: string; +export interface DatabaseOperation extends ProxyResource { + readonly databaseName?: string; + readonly operation?: string; + readonly operationFriendlyName?: string; + readonly percentComplete?: number; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly 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 PartnerInfo class. + * Initializes a new instance of the ElasticPoolOperation class. * @constructor - * Partner server information for the failover group. + * A elastic pool operation. + * + * @member {string} [elasticPoolName] The name of the elastic pool the + * operation is being performed on. + * @member {string} [operation] The name of operation. + * @member {string} [operationFriendlyName] The friendly name of operation. + * @member {number} [percentComplete] The percentage of the operation + * completed. + * @member {string} [serverName] The name of the server. + * @member {date} [startTime] The operation start time. + * @member {string} [state] The operation state. + * @member {number} [errorCode] The operation error code. + * @member {string} [errorDescription] The operation error description. + * @member {number} [errorSeverity] The operation error severity. + * @member {boolean} [isUserError] Whether or not the error is a user error. + * @member {date} [estimatedCompletionTime] The estimated completion time of + * the operation. + * @member {string} [description] The operation description. + * @member {boolean} [isCancellable] Whether the operation can be cancelled. + */ +export interface ElasticPoolOperation extends ProxyResource { + readonly elasticPoolName?: string; + readonly operation?: string; + readonly operationFriendlyName?: string; + readonly percentComplete?: number; + readonly serverName?: string; + readonly startTime?: Date; + readonly state?: string; + readonly errorCode?: number; + readonly errorDescription?: string; + readonly errorSeverity?: number; + readonly isUserError?: boolean; + readonly estimatedCompletionTime?: Date; + readonly description?: string; + readonly isCancellable?: boolean; +} + +/** + * @class + * Initializes a new instance of the MaxSizeCapability class. + * @constructor + * The maximum size capability. * - * @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 {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 PartnerInfo { - id: string; - readonly location?: string; - readonly replicationRole?: string; +export interface MaxSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the FailoverGroup class. + * Initializes a new instance of the LogSizeCapability class. * @constructor - * A failover group. + * The log size capability. * - * @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 {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 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 LogSizeCapability { + readonly limit?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the FailoverGroupUpdate class. + * Initializes a new instance of the MaxSizeRangeCapability class. * @constructor - * A failover group update request. + * The maximum size range capability. * - * @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 {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 FailoverGroupUpdate { - readWriteEndpoint?: FailoverGroupReadWriteEndpoint; - readOnlyEndpoint?: FailoverGroupReadOnlyEndpoint; - databases?: string[]; - tags?: { [propertyName: string]: 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 OperationDisplay class. + * Initializes a new instance of the PerformanceLevelCapability class. * @constructor - * Display metadata associated with the operation. + * The performance level capability. * - * @member {string} [provider] The localized friendly form of the resource - * provider name. - * @member {string} [resource] The localized friendly form of the resource type - * related to this action/operation. - * @member {string} [operation] The localized friendly name for the operation. - * @member {string} [description] The localized friendly description for the - * operation. + * @member {number} [value] Performance level value. + * @member {string} [unit] Unit type used to measure performance level. + * Possible values include: 'DTU', 'VCores' */ -export interface OperationDisplay { - readonly provider?: string; - readonly resource?: string; - readonly operation?: string; - readonly description?: string; +export interface PerformanceLevelCapability { + readonly value?: number; + readonly unit?: string; } /** * @class - * Initializes a new instance of the Operation class. + * Initializes a new instance of the Sku class. * @constructor - * SQL REST API operation definition. + * An ARM Resource SKU. * - * @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} 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 Operation { - readonly name?: string; - readonly display?: OperationDisplay; - readonly origin?: string; - readonly properties?: { [propertyName: string]: any }; +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; } /** * @class - * Initializes a new instance of the ServerKey class. + * Initializes a new instance of the LicenseTypeCapability class. * @constructor - * A server key. + * The license type capability * - * @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} [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 ServerKey extends ProxyResource { - kind?: string; - readonly location?: string; - readonly subregion?: string; - serverKeyType: string; - uri?: string; - thumbprint?: string; - creationDate?: Date; +export interface LicenseTypeCapability { + readonly name?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the ResourceIdentity class. + * Initializes a new instance of the ServiceObjectiveCapability class. * @constructor - * Azure Active Directory identity configuration for a resource. + * The service objectives capability. * - * @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 {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 ResourceIdentity { - readonly principalId?: string; - type?: string; - readonly tenantId?: 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 Server class. + * Initializes a new instance of the EditionCapability class. * @constructor - * An Azure SQL Database server. + * The edition capability. * - * @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} [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 Server extends TrackedResource { - identity?: ResourceIdentity; - readonly kind?: string; - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: 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 ServerUpdate class. + * Initializes a new instance of the ElasticPoolPerDatabaseMinPerformanceLevelCapability class. * @constructor - * An update request for an Azure SQL Database server. + * The minimum per-database performance level capability. * - * @member {string} [administratorLogin] Administrator username for the server. - * Once created it cannot be changed. - * @member {string} [administratorLoginPassword] The administrator login - * password (required for server creation). - * @member {string} [version] The version of the server. - * @member {string} [state] The state of the server. - * @member {string} [fullyQualifiedDomainName] The fully qualified domain name - * of the server. - * @member {object} [tags] Resource tags. + * @member {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 ServerUpdate { - administratorLogin?: string; - administratorLoginPassword?: string; - version?: string; - readonly state?: string; - readonly fullyQualifiedDomainName?: string; - tags?: { [propertyName: string]: string }; +export interface ElasticPoolPerDatabaseMinPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncAgent class. + * Initializes a new instance of the ElasticPoolPerDatabaseMaxPerformanceLevelCapability class. * @constructor - * An Azure SQL Database sync agent. + * The max per-database performance level capability. * - * @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 {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 SyncAgent extends ProxyResource { - readonly syncAgentName?: string; - syncDatabaseId?: string; - readonly lastAliveTime?: Date; - readonly state?: string; - readonly isUpToDate?: boolean; - readonly expiryTime?: Date; - readonly version?: string; +export interface ElasticPoolPerDatabaseMaxPerformanceLevelCapability { + readonly limit?: number; + readonly unit?: string; + readonly supportedPerDatabaseMinPerformanceLevels?: ElasticPoolPerDatabaseMinPerformanceLevelCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncAgentKeyProperties class. + * Initializes a new instance of the ElasticPoolPerformanceLevelCapability class. * @constructor - * Properties of an Azure SQL Database sync agent key. + * The Elastic Pool performance level capability. * - * @member {string} [syncAgentKey] Key of sync agent. + * @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 SyncAgentKeyProperties { - readonly syncAgentKey?: 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 SyncAgentLinkedDatabase class. + * Initializes a new instance of the ElasticPoolEditionCapability class. * @constructor - * An Azure SQL Database sync agent linked database. + * The elastic pool edition 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 {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 SyncAgentLinkedDatabase extends ProxyResource { - readonly databaseType?: string; - readonly databaseId?: string; - readonly description?: string; - readonly serverName?: string; - readonly databaseName?: string; - readonly userName?: 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 SyncDatabaseIdProperties class. + * Initializes a new instance of the ServerVersionCapability class. * @constructor - * Properties of the sync database id. + * The server capability * - * @member {string} [id] ARM resource id of sync database. + * @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 SyncDatabaseIdProperties { - readonly id?: 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 SyncFullSchemaTableColumn class. + * Initializes a new instance of the ManagedInstanceVcoresCapability class. * @constructor - * Properties of the column in the table of database full schema. + * The managed instance virtual cores 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 {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 SyncFullSchemaTableColumn { - readonly dataSize?: string; - readonly dataType?: string; - readonly errorId?: string; - readonly hasError?: boolean; - readonly isPrimaryKey?: boolean; +export interface ManagedInstanceVcoresCapability { readonly name?: string; - readonly quotedName?: string; + readonly value?: number; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncFullSchemaTable class. + * Initializes a new instance of the ManagedInstanceFamilyCapability class. * @constructor - * Properties of the table in the database full schema. + * The managed server family 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 {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 SyncFullSchemaTable { - readonly columns?: SyncFullSchemaTableColumn[]; - readonly errorId?: string; - readonly hasError?: boolean; +export interface ManagedInstanceFamilyCapability { readonly name?: string; - readonly quotedName?: 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 SyncFullSchemaProperties class. + * Initializes a new instance of the ManagedInstanceEditionCapability class. * @constructor - * Properties of the database full schema. + * The managed server capability * - * @member {array} [tables] List of tables in the database full schema. - * @member {date} [lastUpdateTime] Last update time of the database schema. + * @member {string} [name] 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 SyncFullSchemaProperties { - readonly tables?: SyncFullSchemaTable[]; - readonly lastUpdateTime?: Date; +export interface ManagedInstanceEditionCapability { + readonly name?: string; + readonly supportedFamilies?: ManagedInstanceFamilyCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupLogProperties class. + * Initializes a new instance of the ManagedInstanceVersionCapability class. * @constructor - * Properties of an Azure SQL Database sync group log. + * The managed instance 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] 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 SyncGroupLogProperties { - readonly timestamp?: Date; - readonly type?: string; - readonly source?: string; - readonly details?: string; - readonly tracingId?: string; - readonly operationStatus?: string; +export interface ManagedInstanceVersionCapability { + readonly name?: string; + readonly supportedEditions?: ManagedInstanceEditionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTableColumn class. + * Initializes a new instance of the LocationCapabilities class. * @constructor - * Properties of column in sync group table. + * The location capability. * - * @member {string} [quotedName] Quoted name of sync group table column. - * @member {string} [dataSize] Data size of the column. - * @member {string} [dataType] Data type of the column. + * @member {string} [name] The 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 SyncGroupSchemaTableColumn { - quotedName?: string; - dataSize?: string; - dataType?: string; +export interface LocationCapabilities { + readonly name?: string; + readonly supportedServerVersions?: ServerVersionCapability[]; + readonly supportedManagedInstanceVersions?: ManagedInstanceVersionCapability[]; + readonly status?: string; + reason?: string; } /** * @class - * Initializes a new instance of the SyncGroupSchemaTable class. + * Initializes a new instance of the Database class. * @constructor - * Properties of table in sync group schema. + * A database resource. + * + * @member {object} [sku] The name and tier of the SKU. + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [kind] Kind of database. This is metadata used for the + * Azure portal experience. + * @member {string} [managedBy] Resource that manages the database. + * @member {string} [createMode] Specifies the mode of database creation. * - * @member {array} [columns] List of columns in sync group schema. - * @member {string} [quotedName] Quoted name of sync group schema table. + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * @member {string} [collation] The collation of the database. + * @member {number} [maxSizeBytes] The max size of the database expressed in + * bytes. + * @member {string} [sampleName] The name of the sample schema to apply when + * creating this database. Possible values include: 'AdventureWorksLT', + * 'WideWorldImportersStd', 'WideWorldImportersFull' + * @member {string} [elasticPoolId] The resource identifier of the elastic pool + * containing this database. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [status] The status of the database. Possible values + * include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', + * 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', + * 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', 'Paused', + * 'Resuming', 'Scaling' + * @member {uuid} [databaseId] The ID of the database. + * @member {date} [creationDate] The creation date of the database (ISO8601 + * format). + * @member {string} [currentServiceObjectiveName] The current service level + * objective name of the database. + * @member {string} [requestedServiceObjectiveName] The requested service level + * objective name of the database. + * @member {string} [defaultSecondaryLocation] The default secondary region for + * this database. + * @member {string} [failoverGroupId] Failover Group resource identifier that + * this database belongs to. + * @member {date} [restorePointInTime] Specifies the point in time (ISO8601 + * format) of the source database that will be restored to create the new + * database. + * @member {date} [sourceDatabaseDeletionDate] Specifies the time that the + * database was deleted. + * @member {string} [recoveryServicesRecoveryPointId] The resource identifier + * of the recovery point associated with create operation of this database. + * @member {string} [longTermRetentionBackupResourceId] The resource identifier + * of the long term retention backup associated with create operation of this + * database. + * @member {string} [recoverableDatabaseId] The resource identifier of the + * recoverable database associated with create operation of this database. + * @member {string} [restorableDroppedDatabaseId] The resource identifier of + * the restorable dropped database associated with create operation of this + * database. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {boolean} [zoneRedundant] Whether or not this database is zone + * redundant, which means the replicas of this database will be spread across + * multiple availability zones. + * @member {string} [licenseType] The license type to apply for this database. + * Possible values include: 'LicenseIncluded', 'BasePrice' + * @member {number} [maxLogSizeBytes] The max log size for this database. + * @member {date} [earliestRestoreDate] This records the earliest start date + * and time that restore is available for this database (ISO8601 format). + * @member {string} [readScale] The state of read-only routing. If enabled, + * connections that have application intent set to readonly in their connection + * string may be routed to a readonly secondary replica in the same region. + * Possible values include: 'Enabled', 'Disabled' + * @member {object} [currentSku] The name and tier of the SKU. + * @member {string} [currentSku.name] The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * @member {string} [currentSku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * @member {string} [currentSku.size] Size of the particular SKU + * @member {string} [currentSku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * @member {number} [currentSku.capacity] Capacity of the particular SKU. */ -export interface SyncGroupSchemaTable { - columns?: SyncGroupSchemaTableColumn[]; - quotedName?: 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 SyncGroupSchema class. + * Initializes a new instance of the DatabaseUpdate class. * @constructor - * Properties of sync group schema. + * 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 {array} [tables] List of tables in sync group schema. - * @member {string} [masterSyncMemberName] Name of master sync member where the - * schema is from. - */ -export interface SyncGroupSchema { - tables?: SyncGroupSchemaTable[]; - masterSyncMemberName?: string; + * 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 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 SyncGroup class. + * Initializes a new instance of the ResourceMoveDefinition class. * @constructor - * An Azure SQL Database sync group. + * Contains the information necessary to perform a resource move (rename). * - * @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 {string} id The target ID for the resource */ -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 ResourceMoveDefinition { + id: string; } /** * @class - * Initializes a new instance of the SyncMember class. + * Initializes a new instance of the ElasticPoolPerDatabaseSettings class. * @constructor - * An Azure SQL Database sync member. + * Per database settings of an elastic pool. * - * @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 {number} [minCapacity] The minimum capacity all databases are + * guaranteed. + * @member {number} [maxCapacity] The maximum capacity any one database can + * consume. */ -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 ElasticPoolPerDatabaseSettings { + minCapacity?: number; + maxCapacity?: number; } /** * @class - * Initializes a new instance of the VirtualNetworkRule class. + * Initializes a new instance of the ElasticPool class. * @constructor - * A virtual network rule. - * - * @member {string} virtualNetworkSubnetId The ARM resource id of the virtual - * network subnet. - * @member {boolean} [ignoreMissingVnetServiceEndpoint] Create firewall rule - * before the virtual network has vnet service endpoint enabled. - * @member {string} [state] Virtual Network Rule State. Possible values - * include: 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + * 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 VirtualNetworkRule extends ProxyResource { - virtualNetworkSubnetId: string; - ignoreMissingVnetServiceEndpoint?: boolean; +export interface ElasticPool extends TrackedResource { + sku?: Sku; + readonly kind?: string; readonly state?: string; + readonly creationDate?: Date; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; } /** * @class - * Initializes a new instance of the DatabaseOperation class. + * Initializes a new instance of the ElasticPoolUpdate 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. + * 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 DatabaseOperation extends ProxyResource { - readonly databaseName?: string; - readonly operation?: string; - readonly operationFriendlyName?: string; - readonly percentComplete?: number; - readonly serverName?: string; - readonly startTime?: Date; - readonly state?: string; - readonly errorCode?: number; - readonly errorDescription?: string; - readonly errorSeverity?: number; - readonly isUserError?: boolean; +export interface ElasticPoolUpdate { + sku?: Sku; + maxSizeBytes?: number; + perDatabaseSettings?: ElasticPoolPerDatabaseSettings; + zoneRedundant?: boolean; + licenseType?: string; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the RestorePointListResult class. + * Initializes a new instance of the RecoverableDatabaseListResult class. * @constructor - * The response to a list database restore points request. + * The response to a list recoverable databases request * */ -export interface RestorePointListResult extends Array { +export interface RecoverableDatabaseListResult extends Array { } /** * @class - * Initializes a new instance of the RecoverableDatabaseListResult class. + * Initializes a new instance of the RestorableDroppedDatabaseListResult class. * @constructor - * The response to a list recoverable databases request + * The response to a list restorable dropped databases request * */ -export interface RecoverableDatabaseListResult extends Array { +export interface RestorableDroppedDatabaseListResult extends Array { } /** * @class - * Initializes a new instance of the RestorableDroppedDatabaseListResult class. + * Initializes a new instance of the ServerListResult class. * @constructor - * The response to a list restorable dropped databases request + * A list of servers. * + * @member {string} [nextLink] Link to retrieve next page of results. */ -export interface RestorableDroppedDatabaseListResult extends Array { +export interface ServerListResult extends Array { + readonly nextLink?: string; } /** @@ -2452,20 +2940,44 @@ export interface MetricDefinitionListResult extends Array { * @class * Initializes a new instance of the DatabaseListResult class. * @constructor - * Represents the response to a list database request. + * A list of databases. * + * @member {string} [nextLink] Link to retrieve next page of results. */ export interface DatabaseListResult extends Array { + readonly nextLink?: string; } /** * @class * Initializes a new instance of the ElasticPoolListResult class. * @constructor - * Represents the response to a list elastic pool request. + * The result of an elastic pool list request. * + * @member {string} [nextLink] Link to retrieve next page of results. */ export interface ElasticPoolListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the 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 { } /** @@ -2508,18 +3020,6 @@ export interface ServerCommunicationLinkListResult extends Array { } -/** - * @class - * Initializes a new instance of the ServerListResult class. - * @constructor - * A list of servers. - * - * @member {string} [nextLink] Link to retrieve next page of results. - */ -export interface ServerListResult extends Array { - readonly nextLink?: string; -} - /** * @class * Initializes a new instance of the ElasticPoolActivityListResult class. @@ -2540,26 +3040,6 @@ export interface ElasticPoolActivityListResult extends Array { } -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListResult class. - * @constructor - * Represents the response to a list recommended elastic pool request. - * - */ -export interface RecommendedElasticPoolListResult extends Array { -} - -/** - * @class - * Initializes a new instance of the RecommendedElasticPoolListMetricsResult class. - * @constructor - * Represents the response to a list recommended elastic pool metrics request. - * - */ -export interface RecommendedElasticPoolListMetricsResult extends Array { -} - /** * @class * Initializes a new instance of the ServiceTierAdvisorListResult class. @@ -2733,6 +3213,18 @@ export interface SyncMemberListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the SubscriptionUsageListResult class. + * @constructor + * A list of subscription usage metrics in a location. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface SubscriptionUsageListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the VirtualNetworkRuleListResult class. @@ -2745,6 +3237,42 @@ export interface VirtualNetworkRuleListResult extends Array readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the LongTermRetentionBackupListResult class. + * @constructor + * A list of long term retention bacukps. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface LongTermRetentionBackupListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ServerDnsAliasListResult class. + * @constructor + * A list of server DNS aliases. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ServerDnsAliasListResult extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RestorePointListResult class. + * @constructor + * A list of long term retention bacukps. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface RestorePointListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the DatabaseOperationListResult class. @@ -2756,3 +3284,15 @@ export interface VirtualNetworkRuleListResult extends Array export interface DatabaseOperationListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the ElasticPoolOperationListResult class. + * @constructor + * The response to a list elastic pool operations request + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ElasticPoolOperationListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index 8699dee3ab..eb58f54c80 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -19,22 +19,12 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Resource = require('./resource'); -exports.ProxyResource = require('./proxyResource'); -exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); -exports.BackupLongTermRetentionVault = require('./backupLongTermRetentionVault'); exports.TrackedResource = require('./trackedResource'); -exports.RestorePoint = require('./restorePoint'); +exports.ProxyResource = require('./proxyResource'); exports.RecoverableDatabase = require('./recoverableDatabase'); exports.RestorableDroppedDatabase = require('./restorableDroppedDatabase'); -exports.MaxSizeCapability = require('./maxSizeCapability'); -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.DatabaseSecurityAlertPolicy = require('./databaseSecurityAlertPolicy'); exports.DataMaskingPolicy = require('./dataMaskingPolicy'); @@ -50,29 +40,25 @@ exports.MetricName = require('./metricName'); exports.Metric = require('./metric'); exports.MetricAvailability = require('./metricAvailability'); exports.MetricDefinition = require('./metricDefinition'); +exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); +exports.RecommendedElasticPool = require('./recommendedElasticPool'); exports.ReplicationLink = require('./replicationLink'); exports.ServerAzureADAdministrator = require('./serverAzureADAdministrator'); exports.ServerCommunicationLink = require('./serverCommunicationLink'); exports.ServiceObjective = require('./serviceObjective'); -exports.CheckNameAvailabilityRequest = require('./checkNameAvailabilityRequest'); -exports.CheckNameAvailabilityResponse = require('./checkNameAvailabilityResponse'); -exports.RecommendedElasticPoolMetric = require('./recommendedElasticPoolMetric'); -exports.SloUsageMetric = require('./sloUsageMetric'); -exports.ServiceTierAdvisor = require('./serviceTierAdvisor'); -exports.TransparentDataEncryption = require('./transparentDataEncryption'); -exports.OperationImpact = require('./operationImpact'); -exports.RecommendedIndex = require('./recommendedIndex'); -exports.Database = require('./database'); -exports.RecommendedElasticPool = require('./recommendedElasticPool'); -exports.ElasticPool = require('./elasticPool'); -exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); exports.ElasticPoolActivity = require('./elasticPoolActivity'); exports.ElasticPoolDatabaseActivity = require('./elasticPoolDatabaseActivity'); -exports.DatabaseUpdate = require('./databaseUpdate'); +exports.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'); +exports.AutomaticTuningOptions = require('./automaticTuningOptions'); +exports.DatabaseAutomaticTuning = require('./databaseAutomaticTuning'); exports.EncryptionProtector = require('./encryptionProtector'); exports.FailoverGroupReadWriteEndpoint = require('./failoverGroupReadWriteEndpoint'); exports.FailoverGroupReadOnlyEndpoint = require('./failoverGroupReadOnlyEndpoint'); @@ -98,11 +84,45 @@ exports.SyncGroupSchemaTable = require('./syncGroupSchemaTable'); exports.SyncGroupSchema = require('./syncGroupSchema'); exports.SyncGroup = require('./syncGroup'); exports.SyncMember = require('./syncMember'); +exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); +exports.LongTermRetentionBackup = require('./longTermRetentionBackup'); +exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); +exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions'); +exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); +exports.ServerDnsAlias = require('./serverDnsAlias'); +exports.ServerDnsAliasAcquisition = require('./serverDnsAliasAcquisition'); +exports.RestorePoint = require('./restorePoint'); +exports.CreateDatabaseRestorePointDefinition = require('./createDatabaseRestorePointDefinition'); exports.DatabaseOperation = require('./databaseOperation'); -exports.RestorePointListResult = require('./restorePointListResult'); +exports.ElasticPoolOperation = require('./elasticPoolOperation'); +exports.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.DataMaskingRuleListResult = require('./dataMaskingRuleListResult'); exports.FirewallRuleListResult = require('./firewallRuleListResult'); exports.GeoBackupPolicyListResult = require('./geoBackupPolicyListResult'); @@ -110,15 +130,14 @@ exports.MetricListResult = require('./metricListResult'); exports.MetricDefinitionListResult = require('./metricDefinitionListResult'); exports.DatabaseListResult = require('./databaseListResult'); exports.ElasticPoolListResult = require('./elasticPoolListResult'); +exports.RecommendedElasticPoolListResult = require('./recommendedElasticPoolListResult'); +exports.RecommendedElasticPoolListMetricsResult = require('./recommendedElasticPoolListMetricsResult'); exports.ReplicationLinkListResult = require('./replicationLinkListResult'); exports.ServerAdministratorListResult = require('./serverAdministratorListResult'); exports.ServerCommunicationLinkListResult = require('./serverCommunicationLinkListResult'); exports.ServiceObjectiveListResult = require('./serviceObjectiveListResult'); -exports.ServerListResult = require('./serverListResult'); 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'); @@ -134,5 +153,10 @@ exports.SyncFullSchemaPropertiesListResult = require('./syncFullSchemaProperties exports.SyncGroupLogListResult = require('./syncGroupLogListResult'); exports.SyncGroupListResult = require('./syncGroupListResult'); exports.SyncMemberListResult = require('./syncMemberListResult'); +exports.SubscriptionUsageListResult = require('./subscriptionUsageListResult'); exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); +exports.LongTermRetentionBackupListResult = require('./longTermRetentionBackupListResult'); +exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); +exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); +exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); diff --git a/lib/services/sqlManagement2/lib/models/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/longTermRetentionBackup.js b/lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js new file mode 100644 index 0000000000..d5c13d1442 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/longTermRetentionBackup.js @@ -0,0 +1,129 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A long term retention backup. + * + * @extends models['ProxyResource'] + */ +class LongTermRetentionBackup extends models['ProxyResource'] { + /** + * Create a LongTermRetentionBackup. + * @member {string} [serverName] The server name that the backup database + * belong to. + * @member {date} [serverCreateTime] The create time of the server. + * @member {string} [databaseName] The name of the database the backup belong + * to + * @member {date} [databaseDeletionTime] The delete time of the database + * @member {date} [backupTime] The time the backup was taken + * @member {date} [backupExpirationTime] The time the long term retention + * backup will expire. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LongTermRetentionBackup + * + * @returns {object} metadata of LongTermRetentionBackup + * + */ + mapper() { + return { + required: false, + serializedName: 'LongTermRetentionBackup', + type: { + name: 'Composite', + className: 'LongTermRetentionBackup', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + serverName: { + required: false, + readOnly: true, + serializedName: 'properties.serverName', + type: { + name: 'String' + } + }, + serverCreateTime: { + required: false, + readOnly: true, + serializedName: 'properties.serverCreateTime', + type: { + name: 'DateTime' + } + }, + databaseName: { + required: false, + readOnly: true, + serializedName: 'properties.databaseName', + type: { + name: 'String' + } + }, + databaseDeletionTime: { + required: false, + readOnly: true, + serializedName: 'properties.databaseDeletionTime', + type: { + name: 'DateTime' + } + }, + backupTime: { + required: false, + readOnly: true, + serializedName: 'properties.backupTime', + type: { + name: 'DateTime' + } + }, + backupExpirationTime: { + required: false, + readOnly: true, + serializedName: 'properties.backupExpirationTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = LongTermRetentionBackup; diff --git a/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js b/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js new file mode 100644 index 0000000000..a03e44911a --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/longTermRetentionBackupListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of long term retention bacukps. + */ +class LongTermRetentionBackupListResult extends Array { + /** + * Create a LongTermRetentionBackupListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of LongTermRetentionBackupListResult + * + * @returns {object} metadata of LongTermRetentionBackupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'LongTermRetentionBackupListResult', + type: { + name: 'Composite', + className: 'LongTermRetentionBackupListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LongTermRetentionBackupElementType', + type: { + name: 'Composite', + className: 'LongTermRetentionBackup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = LongTermRetentionBackupListResult; diff --git a/lib/services/sqlManagement2/lib/models/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/resourceMoveDefinition.js b/lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js new file mode 100644 index 0000000000..db42dcff0f --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/resourceMoveDefinition.js @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the information necessary to perform a resource move (rename). + * + */ +class ResourceMoveDefinition { + /** + * Create a ResourceMoveDefinition. + * @member {string} id The target ID for the resource + */ + constructor() { + } + + /** + * Defines the metadata of ResourceMoveDefinition + * + * @returns {object} metadata of ResourceMoveDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMoveDefinition', + type: { + name: 'Composite', + className: 'ResourceMoveDefinition', + modelProperties: { + id: { + required: true, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceMoveDefinition; diff --git a/lib/services/sqlManagement2/lib/models/restorePoint.js b/lib/services/sqlManagement2/lib/models/restorePoint.js index 0df5375556..0765e34c30 100644 --- a/lib/services/sqlManagement2/lib/models/restorePoint.js +++ b/lib/services/sqlManagement2/lib/models/restorePoint.js @@ -13,20 +13,21 @@ const models = require('./index'); /** - * A database restore point. + * Database restore points. * * @extends models['ProxyResource'] */ class RestorePoint extends models['ProxyResource'] { /** * Create a RestorePoint. - * @member {string} [restorePointType] The restore point type of the database - * restore point. Possible values include: 'DISCRETE', 'CONTINUOUS' - * @member {date} [restorePointCreationDate] Restore point creation time - * (ISO8601 format). Populated when restorePointType = CONTINUOUS. Null - * otherwise. - * @member {date} [earliestRestoreDate] Earliest restore time (ISO8601 - * format). Populated when restorePointType = DISCRETE. Null otherwise. + * @member {string} [location] Resource location. + * @member {string} [restorePointType] The type of restore point. Possible + * values include: 'CONTINUOUS', 'DISCRETE' + * @member {date} [earliestRestoreDate] The earliest time to which this + * database can be restored + * @member {date} [restorePointCreationDate] The time the backup was taken + * @member {string} [restorePointLabel] The label of restore point for backup + * request by user */ constructor() { super(); @@ -70,13 +71,29 @@ class RestorePoint extends models['ProxyResource'] { name: 'String' } }, + location: { + required: false, + readOnly: true, + serializedName: 'location', + type: { + name: 'String' + } + }, restorePointType: { required: false, readOnly: true, serializedName: 'properties.restorePointType', type: { name: 'Enum', - allowedValues: [ 'DISCRETE', 'CONTINUOUS' ] + allowedValues: [ 'CONTINUOUS', 'DISCRETE' ] + } + }, + earliestRestoreDate: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestoreDate', + type: { + name: 'DateTime' } }, restorePointCreationDate: { @@ -87,12 +104,12 @@ class RestorePoint extends models['ProxyResource'] { name: 'DateTime' } }, - earliestRestoreDate: { + restorePointLabel: { required: false, readOnly: true, - serializedName: 'properties.earliestRestoreDate', + serializedName: 'properties.restorePointLabel', type: { - name: 'DateTime' + name: 'String' } } } diff --git a/lib/services/sqlManagement2/lib/models/restorePointListResult.js b/lib/services/sqlManagement2/lib/models/restorePointListResult.js index 013c4b5fda..e89c1079ba 100644 --- a/lib/services/sqlManagement2/lib/models/restorePointListResult.js +++ b/lib/services/sqlManagement2/lib/models/restorePointListResult.js @@ -11,11 +11,12 @@ 'use strict'; /** - * The response to a list database restore points request. + * A list of long term retention bacukps. */ class RestorePointListResult extends Array { /** * Create a RestorePointListResult. + * @member {string} [nextLink] Link to retrieve next page of results. */ constructor() { super(); @@ -36,7 +37,8 @@ class RestorePointListResult extends Array { className: 'RestorePointListResult', modelProperties: { value: { - required: true, + required: false, + readOnly: true, serializedName: '', type: { name: 'Sequence', diff --git a/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js b/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js new file mode 100644 index 0000000000..339999b62f --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverAutomaticTuning.js @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Server-level Automatic Tuning. + * + * @extends models['ProxyResource'] + */ +class ServerAutomaticTuning extends models['ProxyResource'] { + /** + * Create a ServerAutomaticTuning. + * @member {string} [desiredState] Automatic tuning desired state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {string} [actualState] Automatic tuning actual state. Possible + * values include: 'Custom', 'Auto', 'Unspecified' + * @member {object} [options] Automatic tuning options definition. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerAutomaticTuning + * + * @returns {object} metadata of ServerAutomaticTuning + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerAutomaticTuning', + type: { + name: 'Composite', + className: 'ServerAutomaticTuning', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + desiredState: { + required: false, + serializedName: 'properties.desiredState', + type: { + name: 'Enum', + allowedValues: [ 'Custom', 'Auto', 'Unspecified' ] + } + }, + actualState: { + required: false, + readOnly: true, + serializedName: 'properties.actualState', + type: { + name: 'Enum', + allowedValues: [ 'Custom', 'Auto', 'Unspecified' ] + } + }, + options: { + required: false, + serializedName: 'properties.options', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AutomaticTuningServerOptionsElementType', + type: { + name: 'Composite', + className: 'AutomaticTuningServerOptions' + } + } + } + } + } + } + }; + } +} + +module.exports = ServerAutomaticTuning; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAlias.js b/lib/services/sqlManagement2/lib/models/serverDnsAlias.js new file mode 100644 index 0000000000..34d55a5648 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAlias.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A server DNS alias. + * + * @extends models['ProxyResource'] + */ +class ServerDnsAlias extends models['ProxyResource'] { + /** + * Create a ServerDnsAlias. + * @member {string} [azureDnsRecord] The fully qualified DNS record for alias + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerDnsAlias + * + * @returns {object} metadata of ServerDnsAlias + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAlias', + type: { + name: 'Composite', + className: 'ServerDnsAlias', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + azureDnsRecord: { + required: false, + readOnly: true, + serializedName: 'properties.azureDnsRecord', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAlias; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js b/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js new file mode 100644 index 0000000000..7ea9139af4 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAliasAcquisition.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A server DNS alias acquisition request. + * + */ +class ServerDnsAliasAcquisition { + /** + * Create a ServerDnsAliasAcquisition. + * @member {string} [oldServerDnsAliasId] The id of the server alias that + * will be acquired to point to this server instead. + */ + constructor() { + } + + /** + * Defines the metadata of ServerDnsAliasAcquisition + * + * @returns {object} metadata of ServerDnsAliasAcquisition + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAliasAcquisition', + type: { + name: 'Composite', + className: 'ServerDnsAliasAcquisition', + modelProperties: { + oldServerDnsAliasId: { + required: false, + serializedName: 'oldServerDnsAliasId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAliasAcquisition; diff --git a/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js b/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js new file mode 100644 index 0000000000..6d85947ac1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/serverDnsAliasListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of server DNS aliases. + */ +class ServerDnsAliasListResult extends Array { + /** + * Create a ServerDnsAliasListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerDnsAliasListResult + * + * @returns {object} metadata of ServerDnsAliasListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerDnsAliasListResult', + type: { + name: 'Composite', + className: 'ServerDnsAliasListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServerDnsAliasElementType', + type: { + name: 'Composite', + className: 'ServerDnsAlias' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerDnsAliasListResult; diff --git a/lib/services/sqlManagement2/lib/models/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/models/sloUsageMetric.js b/lib/services/sqlManagement2/lib/models/sloUsageMetric.js index 5a33118590..5f0b849435 100644 --- a/lib/services/sqlManagement2/lib/models/sloUsageMetric.js +++ b/lib/services/sqlManagement2/lib/models/sloUsageMetric.js @@ -18,9 +18,15 @@ class SloUsageMetric { /** * Create a SloUsageMetric. * @member {string} [serviceLevelObjective] The serviceLevelObjective for SLO - * usage metric. Possible values include: 'Basic', 'S0', 'S1', 'S2', 'S3', - * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', 'System2', - * 'ElasticPool' + * usage metric. Possible values include: 'System', 'System0', 'System1', + * 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', + * 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', + * 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', + * 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', + * 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', + * 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', + * 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', + * 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' * @member {uuid} [serviceLevelObjectiveId] The serviceLevelObjectiveId for * SLO usage metric. * @member {number} [inRangeTimeRatio] Gets or sets inRangeTimeRatio for SLO diff --git a/lib/services/sqlManagement2/lib/models/subscriptionUsage.js b/lib/services/sqlManagement2/lib/models/subscriptionUsage.js new file mode 100644 index 0000000000..d58c9739c1 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/subscriptionUsage.js @@ -0,0 +1,108 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Usage Metric of a Subscription in a Location. + * + * @extends models['ProxyResource'] + */ +class SubscriptionUsage extends models['ProxyResource'] { + /** + * Create a SubscriptionUsage. + * @member {string} [displayName] User-readable name of the metric. + * @member {number} [currentValue] Current value of the metric. + * @member {number} [limit] Boundary value of the metric. + * @member {string} [unit] Unit of the metric. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubscriptionUsage + * + * @returns {object} metadata of SubscriptionUsage + * + */ + mapper() { + return { + required: false, + serializedName: 'SubscriptionUsage', + type: { + name: 'Composite', + className: 'SubscriptionUsage', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + currentValue: { + required: false, + readOnly: true, + serializedName: 'properties.currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + readOnly: true, + serializedName: 'properties.limit', + type: { + name: 'Number' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'properties.unit', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubscriptionUsage; diff --git a/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js b/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js new file mode 100644 index 0000000000..9405a6b359 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/subscriptionUsageListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of subscription usage metrics in a location. + */ +class SubscriptionUsageListResult extends Array { + /** + * Create a SubscriptionUsageListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubscriptionUsageListResult + * + * @returns {object} metadata of SubscriptionUsageListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'SubscriptionUsageListResult', + type: { + name: 'Composite', + className: 'SubscriptionUsageListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SubscriptionUsageElementType', + type: { + name: 'Composite', + className: 'SubscriptionUsage' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubscriptionUsageListResult; diff --git a/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js b/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js index 7f1daa1b00..c61520f84b 100644 --- a/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/backupLongTermRetentionPolicies.js @@ -15,7 +15,7 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -54,13 +54,10 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let backupLongTermRetentionPolicyName = 'Default'; + let policyName = 'default'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -70,6 +67,9 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -79,12 +79,12 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{backupLongTermRetentionPolicyName}', encodeURIComponent(backupLongTermRetentionPolicyName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -170,7 +170,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -178,16 +178,21 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -261,7 +266,159 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } /** - * Creates or updates a database backup long term retention policy + * Gets a database's long term retention policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabase(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BackupLongTermRetentionPolicy']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -269,16 +426,21 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -309,13 +471,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; - let backupLongTermRetentionPolicyName = 'Default'; + let policyName = 'default'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -328,6 +487,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param if (parameters === null || parameters === undefined) { throw new Error('parameters cannot be null or undefined.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -337,12 +499,12 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{backupLongTermRetentionPolicyName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - requestUrl = requestUrl.replace('{backupLongTermRetentionPolicyName}', encodeURIComponent(backupLongTermRetentionPolicyName)); + requestUrl = requestUrl.replace('{policyName}', encodeURIComponent(policyName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -390,7 +552,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -435,23 +597,6 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupLongTermRetentionPolicy']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -467,11 +612,12 @@ class BackupLongTermRetentionPolicies { this.client = client; this._get = _get; this._createOrUpdate = _createOrUpdate; + this._listByDatabase = _listByDatabase; this._beginCreateOrUpdate = _beginCreateOrUpdate; } /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -507,7 +653,7 @@ class BackupLongTermRetentionPolicies { } /** - * Returns a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -566,7 +712,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -574,16 +720,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -611,7 +762,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -619,16 +770,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -679,7 +835,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -687,16 +843,116 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {object} [options] Optional Parameters. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database's long term retention policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Sets a database's long term retention policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -724,7 +980,7 @@ class BackupLongTermRetentionPolicies { } /** - * Creates or updates a database backup long term retention policy + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -732,16 +988,21 @@ class BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The required parameters to update a backup long - * term retention policy + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/sqlManagement2/lib/operations/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/databaseAutomaticTuningOperations.js b/lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js new file mode 100644 index 0000000000..5bf2f22d25 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/databaseAutomaticTuningOperations.js @@ -0,0 +1,563 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a database's automatic tuning. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update automatic tuning properties for target database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DatabaseAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a DatabaseAutomaticTuningOperations. */ +class DatabaseAutomaticTuningOperations { + /** + * Create a DatabaseAutomaticTuningOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._update = _update; + } + + /** + * Gets a database's automatic tuning. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a database's automatic tuning. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Update automatic tuning properties for target database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update automatic tuning properties for target database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + +} + +module.exports = DatabaseAutomaticTuningOperations; diff --git a/lib/services/sqlManagement2/lib/operations/databaseOperations.js b/lib/services/sqlManagement2/lib/operations/databaseOperations.js index 8eeb0eaf28..28a46543cf 100644 --- a/lib/services/sqlManagement2/lib/operations/databaseOperations.js +++ b/lib/services/sqlManagement2/lib/operations/databaseOperations.js @@ -54,7 +54,7 @@ function _cancel(resourceGroupName, serverName, databaseName, operationId, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2017-10-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -193,7 +193,7 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-03-01-preview'; + let apiVersion = '2017-10-01-preview'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { diff --git a/lib/services/sqlManagement2/lib/operations/databases.js b/lib/services/sqlManagement2/lib/operations/databases.js index 972ce3df41..7febf21ad9 100644 --- a/lib/services/sqlManagement2/lib/operations/databases.js +++ b/lib/services/sqlManagement2/lib/operations/databases.js @@ -31,12 +31,20 @@ const WebResource = msRest.WebResource; * * @param {string} parameters.edition The edition for the database being * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * 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. @@ -648,7 +656,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt /** - * Pauses 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 @@ -656,7 +664,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -675,7 +683,7 @@ function _listMetricDefinitions(resourceGroupName, serverName, databaseName, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _pause(resourceGroupName, serverName, databaseName, options, callback) { +function _upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -688,7 +696,7 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) } // Send request - this.beginPause(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { + this.beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -713,9 +721,8 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) }); } - /** - * Resumes 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 @@ -723,8 +730,6 @@ function _pause(resourceGroupName, serverName, databaseName, options, callback) * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -736,241 +741,117 @@ 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 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 _resume(resourceGroupName, serverName, databaseName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } - - // Send request - this.beginResume(resourceGroupName, serverName, databaseName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Creates a new database or updates an existing database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; + 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 (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); } - if (!callback) { - throw new Error('callback cannot be null.'); + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); } - // 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; + // 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; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); 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) { @@ -979,15 +860,14 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } - /** - * 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 @@ -995,126 +875,7 @@ 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. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1134,102 +895,19 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { +function _get(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } - - // Send request - this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Deletes a database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - 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.'); } @@ -1239,6 +917,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 (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.'); } @@ -1249,10 +930,10 @@ 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}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -1261,7 +942,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1286,7 +967,7 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1314,13 +995,31 @@ 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['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 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 @@ -1328,13 +1027,121 @@ 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} parameters The requested database resource state. * - * @param {object} [options] Optional Parameters. + * @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} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @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 @@ -1352,115 +1159,297 @@ function _deleteMethod(resourceGroupName, serverName, databaseName, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, serverName, databaseName, options, callback) { +function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } + if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : 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 (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.'); - } - } 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}'; - 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('&'); - } + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; if (responseBody === '') responseBody = null; - let parsedErrorResponse; + + // Deserialize Response + let parsedResponse = null; 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'); + 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 (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } 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(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * 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 {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(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); + }); + }); +} + + +/** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @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 + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -1475,14 +1464,14 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * Returns a list of databases in a server. + * 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 @@ -1490,14 +1479,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} elasticPoolName The name of the elastic pool. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1515,7 +1499,7 @@ function _get(resourceGroupName, serverName, databaseName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByServer(resourceGroupName, serverName, options, callback) { +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1525,25 +1509,20 @@ function _listByServer(resourceGroupName, serverName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2014-04-01'; + 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.'); @@ -1554,18 +1533,13 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'; - 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('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1647,8 +1621,9 @@ function _listByServer(resourceGroupName, serverName, options, callback) { }); } + /** - * Gets a database inside of 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 @@ -1656,10 +1631,7 @@ 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 {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -1679,112 +1651,38 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, 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 (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { - throw new Error('databaseName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.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); @@ -1799,14 +1697,15 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * Returns a list of databases in an elastic pool. + * 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 @@ -1814,8 +1713,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 to be resumed. * * @param {object} [options] Optional Parameters. * @@ -1829,120 +1727,50 @@ function _getByElasticPool(resourceGroupName, serverName, elasticPoolName, datab * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link 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 _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 = '2014-04-01'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { - throw new Error('serverName cannot be null or undefined and it must be of type string.'); - } - if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { - throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginResume(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['DatabaseListResult']().mapper(); + let resultMapper = new client.models['Database']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1951,14 +1779,14 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * Gets a database inside of a recommented elastic pool. + * 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 @@ -1966,10 +1794,12 @@ 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 to rename. + * + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {string} databaseName The name of the database to be retrieved. + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -1982,14 +1812,13 @@ function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {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 _getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, callback) { +function _rename(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1999,24 +1828,24 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended 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 (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 (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.'); } @@ -2026,12 +1855,11 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); - requestUrl = requestUrl.replace('{recommendedElasticPoolName}', encodeURIComponent(recommendedElasticPoolName)); 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) { @@ -2040,7 +1868,7 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2058,7 +1886,21 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ResourceMoveDefinition']().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) { @@ -2093,175 +1935,6 @@ function _getByRecommendedElasticPool(resourceGroupName, serverName, recommended // 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); - }); -} - -/** - * Returns a list of databases inside a recommented elastic pool. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {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 _listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, 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('&'); - } - - // 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); }); @@ -2283,12 +1956,20 @@ function _listByRecommendedElasticPool(resourceGroupName, serverName, recommende * * @param {string} parameters.edition The edition for the database being * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' * * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * 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. @@ -2850,7 +2531,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet } /** - * Pauses 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 @@ -2858,7 +2539,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -2877,7 +2558,7 @@ function _beginExportMethod(resourceGroupName, serverName, databaseName, paramet * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginPause(resourceGroupName, serverName, databaseName, options, callback) { +function _beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2887,12 +2568,9 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb 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.'); } @@ -2902,6 +2580,9 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (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.'); } @@ -2911,11 +2592,11 @@ 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'; - 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) { @@ -2983,7 +2664,7 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb } /** - * Resumes 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 @@ -2991,7 +2672,119 @@ 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. + * + * @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. * @@ -3004,13 +2797,14 @@ function _beginPause(resourceGroupName, serverName, databaseName, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginResume(resourceGroupName, serverName, databaseName, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3020,12 +2814,9 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call 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.'); } @@ -3035,6 +2826,12 @@ 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.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.'); } @@ -3044,11 +2841,11 @@ 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'; - 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) { @@ -3057,7 +2854,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 @@ -3075,14 +2872,28 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call } } } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 200) { + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['Database']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3110,13 +2921,47 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Database']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // 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 a new database or updates an existing 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 @@ -3124,130 +2969,7 @@ function _beginResume(resourceGroupName, serverName, databaseName, options, call * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3260,14 +2982,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. + * {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 _beginCreateOrUpdate(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') { @@ -3277,12 +2998,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param 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.'); } @@ -3292,8 +3010,8 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param 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.'); @@ -3305,10 +3023,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -3317,7 +3035,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3335,28 +3053,14 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['Database']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -3384,40 +3088,6 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Database']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -3432,14 +3102,24 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {string} databaseName The name of the database. * - * @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. @@ -3449,9 +3129,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * 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,86 +3152,67 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, param * term retention vault. recoveryServicesRecoveryPointResourceId must be * specified as the recovery point resource ID. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * 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. * @@ -3581,12 +3242,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.'); } @@ -3599,6 +3257,9 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o 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.'); } @@ -3609,10 +3270,10 @@ 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)); 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) { @@ -3710,41 +3371,918 @@ function _beginUpdate(resourceGroupName, serverName, databaseName, parameters, o }); } -/** 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._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._beginImportMethod = _beginImportMethod; - this._beginCreateImportOperation = _beginCreateImportOperation; - this._beginExportMethod = _beginExportMethod; - this._beginPause = _beginPause; - this._beginResume = _beginResume; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdate = _beginUpdate; +/** + * 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; } - - /** - * Imports a bacpac into a new database. + 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 @@ -3752,22 +4290,64 @@ 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} databaseName The name of the database to be exported. * - * @param {string} parameters.databaseName The name of the database to import. + * @param {object} parameters The required parameters for exporting a database. * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. + * @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' @@ -3791,17 +4371,175 @@ class Databases { * @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. + * @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); + } + } + + /** + * Returns database metric definitions. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3812,7 +4550,7 @@ class Databases { } /** - * Imports a bacpac into a new 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 @@ -3820,39 +4558,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3866,7 +4572,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3875,13 +4581,14 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} 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. */ - importMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3890,20 +4597,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._importMethod(resourceGroupName, serverName, parameters, 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._importMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -3911,31 +4617,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3944,15 +4626,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3963,8 +4645,7 @@ class Databases { } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -3972,31 +4653,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -4010,7 +4667,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4018,14 +4675,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4034,19 +4690,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createImportOperation(resourceGroupName, serverName, databaseName, parameters, 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._createImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._upgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Exports a database to a bacpac. + * 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 @@ -4054,27 +4710,6 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4082,15 +4717,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - exportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByServerWithHttpOperationResponse(resourceGroupName, serverName, 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._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4101,7 +4736,7 @@ class Databases { } /** - * Exports a database to a bacpac. + * 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 @@ -4109,27 +4744,6 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4142,7 +4756,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. * @@ -4151,13 +4765,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. */ - exportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByServer(resourceGroupName, serverName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4166,19 +4780,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._exportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._listByServer(resourceGroupName, serverName, 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._listByServer(resourceGroupName, serverName, options, optionalCallback); } } /** - * Returns database metrics. + * 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 @@ -4188,9 +4802,6 @@ class Databases { * * @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 @@ -4198,15 +4809,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) { + getWithHttpOperationResponse(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._get(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4217,7 +4828,7 @@ class Databases { } /** - * Returns database metrics. + * 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 @@ -4227,9 +4838,6 @@ class Databases { * * @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 @@ -4242,7 +4850,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4251,13 +4859,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. + * 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. */ - listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback) { + get(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4266,19 +4874,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, serverName, databaseName, filter, 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._listMetrics(resourceGroupName, serverName, databaseName, filter, options, optionalCallback); + return self._get(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 @@ -4286,7 +4894,119 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database. + * + * @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. * @@ -4295,15 +5015,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. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, 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); } @@ -4314,7 +5034,7 @@ class Databases { } /** - * 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 @@ -4324,6 +5044,118 @@ class Databases { * * @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. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4336,7 +5168,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4345,14 +5177,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * See {@link Database} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback) { + createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4361,19 +5192,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, databaseName, 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._listMetricDefinitions(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Pauses 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 @@ -4381,7 +5212,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. * @@ -4394,11 +5225,11 @@ class Databases { * * @reject {Error} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4409,7 +5240,7 @@ class Databases { } /** - * Pauses 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 @@ -4417,7 +5248,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. * @@ -4445,7 +5276,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { + deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4454,19 +5285,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Resumes a data warehouse. + * 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 @@ -4474,7 +5305,117 @@ 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} 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 {object} [options] Optional Parameters. * @@ -4483,15 +5424,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. */ - resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resume(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); } @@ -4502,7 +5443,7 @@ class Databases { } /** - * Resumes a data warehouse. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4510,71 +5451,24 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to resume. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} databaseName The name of the database. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {object} parameters The requested database resource state. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._resume(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); - } - } - - /** - * Creates a new database or updates an existing database. + * @param {object} [parameters.sku] The name and tier of the 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.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). + * @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. @@ -4584,9 +5478,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 @@ -4607,90 +5501,125 @@ 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.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * 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. + * + * @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 {Database} - 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 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. + */ + update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * 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 {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server. * - * @param {string} parameters.location Resource location. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -4699,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. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, 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._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4718,7 +5647,7 @@ class Databases { } /** - * Creates a new database or updates an existing 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 @@ -4726,130 +5655,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.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -4863,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. * @@ -4872,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. */ - createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4887,19 +5693,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, 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._createOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, 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 @@ -4907,126 +5713,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.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5039,11 +5726,11 @@ class Databases { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + pauseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, 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._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5054,7 +5741,7 @@ class Databases { } /** - * 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 @@ -5062,126 +5749,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.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -5210,7 +5778,7 @@ class Databases { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + pause(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5219,19 +5787,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + self._pause(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._pause(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Deletes 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 @@ -5239,7 +5807,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 to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5248,15 +5816,15 @@ class Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + resumeWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, 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); } @@ -5267,7 +5835,7 @@ class Databases { } /** - * Deletes 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 @@ -5275,7 +5843,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 to be resumed. * * @param {object} [options] Optional Parameters. * @@ -5289,7 +5857,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. * @@ -5297,13 +5865,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. */ - deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { + resume(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5312,19 +5881,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, serverName, 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._deleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._resume(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Gets a database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5332,28 +5901,29 @@ 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 to rename. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + renameWithHttpOperationResponse(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._rename(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5364,7 +5934,7 @@ class Databases { } /** - * Gets a database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5372,13 +5942,14 @@ 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 to rename. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The resource move definition for renaming this + * database. + * + * @param {string} parameters.id The target ID for the resource * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -5390,7 +5961,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5398,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 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. */ - get(resourceGroupName, serverName, databaseName, options, optionalCallback) { + rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5414,19 +5984,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, databaseName, 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._get(resourceGroupName, serverName, databaseName, options, optionalCallback); + return self._rename(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns a list of databases in a server. + * 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 @@ -5434,29 +6004,64 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @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} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * - * @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} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + beginImportMethodWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, 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); } @@ -5467,7 +6072,7 @@ class Databases { } /** - * Returns a list of databases in a server. + * 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 @@ -5475,14 +6080,49 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @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} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * - * @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 @@ -5494,7 +6134,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5503,13 +6143,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { + beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5518,19 +6158,20 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, 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._listByServer(resourceGroupName, serverName, options, optionalCallback); + return self._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); } } /** - * Gets a database inside of an elastic pool. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5538,10 +6179,31 @@ 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 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} databaseName The name of the database to be retrieved. + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -5550,15 +6212,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) { + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, (err, result, request, response) => { + self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5569,7 +6231,8 @@ class Databases { } /** - * Gets a database inside of an elastic pool. + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5577,10 +6240,31 @@ 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 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} databaseName The name of the database to be retrieved. + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' * * @param {object} [options] Optional Parameters. * @@ -5594,7 +6278,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5603,13 +6287,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback) { + beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5618,19 +6302,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, 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._getByElasticPool(resourceGroupName, serverName, elasticPoolName, databaseName, options, optionalCallback); + return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Returns a list of databases in an elastic pool. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5638,8 +6322,26 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be exported. + * + * @param {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. * @@ -5648,15 +6350,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) { + beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, 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); } @@ -5667,7 +6369,7 @@ class Databases { } /** - * Returns a list of databases in an elastic pool. + * Exports a database to a bacpac. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5675,8 +6377,26 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database to be exported. + * + * @param {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. * @@ -5690,7 +6410,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5699,13 +6419,13 @@ class Databases { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * See {@link ImportExportResponse} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5714,19 +6434,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, 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._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Gets a database inside of a recommented elastic pool. + * 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 @@ -5734,10 +6454,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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -5746,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. */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options) { + beginUpgradeDataWarehouseWithHttpOperationResponse(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._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5765,7 +6482,7 @@ class Databases { } /** - * Gets a database inside of a recommented elastic pool. + * 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 @@ -5773,10 +6490,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 upgraded. * * @param {object} [options] Optional Parameters. * @@ -5790,7 +6504,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {Database} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5798,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 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. */ - getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback) { + beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5814,19 +6527,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, 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._getByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, databaseName, options, optionalCallback); + return self._beginUpgradeDataWarehouse(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Returns a list of databases inside 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 @@ -5834,8 +6547,119 @@ 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. + * + * @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. * @@ -5844,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. */ - listByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, recommendedElasticPoolName, options) { + beginCreateOrUpdateWithHttpOperationResponse(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._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5863,16 +6687,127 @@ class Databases { } /** - * Returns a list of databases inside 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 * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * 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} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -5886,7 +6821,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. * @@ -5895,13 +6830,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. */ - listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5910,19 +6845,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, 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._listByRecommendedElasticPool(resourceGroupName, serverName, recommendedElasticPoolName, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Imports a bacpac into a new 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 @@ -5930,39 +6865,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -5971,15 +6874,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) { + beginDeleteMethodWithHttpOperationResponse(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._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5990,7 +6893,7 @@ class Databases { } /** - * Imports a bacpac into a new 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 @@ -5998,39 +6901,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6044,7 +6915,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6052,14 +6923,13 @@ class Databases { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6068,20 +6938,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginImportMethod(resourceGroupName, serverName, parameters, 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._beginImportMethod(resourceGroupName, serverName, parameters, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, serverName, databaseName, options, optionalCallback); } } /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -6089,142 +6958,145 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.name] The name of the extension. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.type] The type of the extension. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @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.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} parameters.storageUri The storage uri to use. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} parameters.administratorLogin The name 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.administratorLoginPassword The password of the - * SQL administrator. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {object} [options] Optional Parameters. + * Default: regular database creation. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * @returns {Promise} A promise is returned + * 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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @reject {Error} - The error object. - */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - 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); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 {string} databaseName The name of the database to import into + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {string} [parameters.collation] The collation of the database. * - * @param {string} [parameters.name] The name of the extension. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} [parameters.type] The type of the extension. + * @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.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing 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.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} parameters.storageUri The storage uri to use. + * @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.administratorLogin The name of the SQL - * administrator. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {function} [optionalCallback] - The optional callback. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @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. * - * {Promise} A promise is returned + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @resolve {ImportExportResponse} - The deserialized result object. + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' * - * @reject {Error} - The error object. + * @param {object} [parameters.tags] Resource tags. * - * {function} optionalCallback(err, result, request, response) + * @param {object} [options] Optional Parameters. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * @returns {Promise} A promise is returned * - * {object} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {stream} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error} - The error object. */ - beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { let client = this.client; let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; }); - } else { - return self._beginCreateImportOperation(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); - } + }); } /** - * 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 @@ -6232,81 +7104,117 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} databaseName The name of the database. * - * @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.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * 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.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.collation] The collation of the database. * - * @param {object} [options] Optional Parameters. + * @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. - */ - beginExportMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Exports a database to a bacpac. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} databaseName The name of the database to be exported. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} parameters The required parameters for exporting a database. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database 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.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database 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.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @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 {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @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.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -6320,7 +7228,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. * @@ -6329,13 +7237,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. */ - beginExportMethod(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') { @@ -6344,19 +7252,19 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginExportMethod(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._beginExportMethod(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } /** - * Pauses a data warehouse. + * 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 @@ -6364,7 +7272,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -6373,7 +7281,7 @@ 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. */ @@ -6392,7 +7300,7 @@ class Databases { } /** - * Pauses a data warehouse. + * 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 @@ -6400,7 +7308,7 @@ class Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the data warehouse to pause. + * @param {string} databaseName The name of the database to be paused. * * @param {object} [options] Optional Parameters. * @@ -6414,7 +7322,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. * @@ -6422,7 +7330,8 @@ 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. * @@ -6449,7 +7358,7 @@ class Databases { } /** - * Resumes a data warehouse. + * 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 @@ -6457,7 +7366,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 resumed. * * @param {object} [options] Optional Parameters. * @@ -6466,7 +7375,7 @@ 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. */ @@ -6485,7 +7394,7 @@ class Databases { } /** - * Resumes a data warehouse. + * 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 @@ -6493,7 +7402,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 resumed. * * @param {object} [options] Optional Parameters. * @@ -6507,7 +7416,7 @@ class Databases { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6515,7 +7424,8 @@ 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. * @@ -6542,138 +7452,10 @@ class Databases { } /** - * Creates a new database or updates an existing database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * Gets a list of databases. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6682,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. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByServerNextWithHttpOperationResponse(nextPageLink, 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._listByServerNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6701,138 +7483,10 @@ class Databases { } /** - * Creates a new database or updates an existing database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. + * Gets a list of databases. * - * @param {string} parameters.location Resource location. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -6846,7 +7500,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. * @@ -6855,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 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. */ - beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByServerNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6870,146 +7524,22 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(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._beginCreateOrUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByServerNext(nextPageLink, options, optionalCallback); } } /** - * Updates an existing database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} 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. + * Gets a list of databases in an elastic pool. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7018,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. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + listByElasticPoolNextWithHttpOperationResponse(nextPageLink, 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._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7037,134 +7567,10 @@ 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. + * Gets a list of databases in an elastic pool. * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7178,7 +7584,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. * @@ -7187,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 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. */ - beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + listByElasticPoolNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7202,14 +7608,14 @@ class Databases { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(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._beginUpdate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + return self._listByElasticPoolNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js b/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js new file mode 100644 index 0000000000..46a0be2f1c --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/elasticPoolOperations.js @@ -0,0 +1,728 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId.toString())); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{elasticPoolName}', encodeURIComponent(elasticPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolOperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByElasticPoolNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolOperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ElasticPoolOperations. */ +class ElasticPoolOperations { + /** + * Create a ElasticPoolOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._cancel = _cancel; + this._listByElasticPool = _listByElasticPool; + this._listByElasticPoolNext = _listByElasticPoolNext; + } + + /** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + cancelWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, operationId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Cancels the asynchronous operation on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._cancel(resourceGroupName, serverName, elasticPoolName, operationId, options, optionalCallback); + } + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByElasticPoolWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByElasticPool(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByElasticPoolNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of operations performed on the elastic pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByElasticPoolNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByElasticPoolNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByElasticPoolNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ElasticPoolOperations; diff --git a/lib/services/sqlManagement2/lib/operations/elasticPools.js b/lib/services/sqlManagement2/lib/operations/elasticPools.js index 614b262a5e..00900cb8d8 100644 --- a/lib/services/sqlManagement2/lib/operations/elasticPools.js +++ b/lib/services/sqlManagement2/lib/operations/elasticPools.js @@ -324,9 +324,8 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, }); } - /** - * 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 @@ -334,134 +333,10 @@ function _listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * 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. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [options] Optional Parameters. + * @param {number} [options.skip] The number of elements in the collection to + * skip. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -473,93 +348,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 ElasticPoolListResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { +function _listByServer(resourceGroupName, serverName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -569,20 +364,21 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, 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 (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 (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.'); @@ -593,12 +389,14 @@ 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}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; 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 = []; + if (skip !== null && skip !== undefined) { + queryParameters.push('$skip=' + encodeURIComponent(skip.toString())); + } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -606,7 +404,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -631,7 +429,7 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -659,6 +457,23 @@ function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); @@ -673,8 +488,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. * @@ -704,12 +518,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) 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.'); } @@ -719,6 +530,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); } + if (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.'); } @@ -729,10 +543,10 @@ 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}'; - 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) { @@ -816,8 +630,9 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) }); } + /** - * 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 @@ -825,6 +640,48 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * * @param {string} serverName The name of the server. * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} 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 @@ -837,34 +694,348 @@ function _get(resourceGroupName, serverName, elasticPoolName, options, callback) * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolListResult} for more information. + * See {@link 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 _listByServer(resourceGroupName, serverName, 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.'); - } + + // 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); + }); + }); +} + + +/** + * 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 + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + 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} resourceGroupName The name of the resource group that + * contains the resource. 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 _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); + }); + }); +} + +/** + * 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.'); } @@ -874,10 +1045,11 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'; - 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)); if (queryParameters.length > 0) { @@ -886,7 +1058,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -904,14 +1076,28 @@ function _listByServer(resourceGroupName, serverName, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ElasticPool']().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) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -946,7 +1132,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ElasticPoolListResult']().mapper(); + let resultMapper = new client.models['ElasticPool']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -956,13 +1142,30 @@ function _listByServer(resourceGroupName, serverName, options, callback) { 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['ElasticPool']().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 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 @@ -970,30 +1173,178 @@ 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 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 {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. + */ +function _beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (elasticPoolName === null || elasticPoolName === undefined || typeof elasticPoolName.valueOf() !== 'string') { + throw new Error('elasticPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'; + 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 = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates an 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. * @@ -1013,7 +1364,7 @@ function _listByServer(resourceGroupName, serverName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1023,12 +1374,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa 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.'); } @@ -1041,6 +1389,9 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa 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.'); } @@ -1051,10 +1402,10 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa // 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) { @@ -1063,7 +1414,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1086,7 +1437,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ElasticPool']().mapper(); + let requestModelMapper = new client.models['ElasticPoolUpdate']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -1102,7 +1453,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa 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); @@ -1147,58 +1498,16 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, pa 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['ElasticPool']().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 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 - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1212,13 +1521,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. + * 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 _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, callback) { +function _listByServerNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1228,23 +1537,10 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters 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 (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.'); @@ -1254,21 +1550,12 @@ 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)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1286,28 +1573,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) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1342,7 +1615,7 @@ function _beginUpdate(resourceGroupName, serverName, elasticPoolName, parameters 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['ElasticPoolListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1367,13 +1640,15 @@ class ElasticPools { this.client = client; this._listMetrics = _listMetrics; this._listMetricDefinitions = _listMetricDefinitions; + this._listByServer = _listByServer; + this._get = _get; this._createOrUpdate = _createOrUpdate; - this._update = _update; this._deleteMethod = _deleteMethod; - this._get = _get; - this._listByServer = _listByServer; + this._update = _update; this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; this._beginUpdate = _beginUpdate; + this._listByServerNext = _listByServerNext; } /** @@ -1472,12 +1747,203 @@ class ElasticPools { }); }); } else { - return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + return self._listMetrics(resourceGroupName, serverName, elasticPoolName, filter, options, optionalCallback); + } + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Returns elastic pool metric definitions. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MetricDefinitionListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + } + } + + /** + * 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); } } /** - * Returns elastic pool metric definitions. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1494,15 +1960,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) { + getWithHttpOperationResponse(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._get(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1513,7 +1979,7 @@ class ElasticPools { } /** - * Returns elastic pool metric definitions. + * Gets an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1535,7 +2001,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1544,14 +2010,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. + * 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. */ - listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1560,19 +2025,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, 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._listMetricDefinitions(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Creates a new elastic pool or 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 @@ -1580,26 +2045,43 @@ 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 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 {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {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. * @@ -1631,7 +2113,7 @@ class ElasticPools { } /** - * Creates a new elastic pool or 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 @@ -1639,26 +2121,43 @@ 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 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 {object} parameters The required parameters for creating or updating - * an elastic pool. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. + * @param {number} [parameters.maxSizeBytes] The storage limit for the database + * elastic pool in bytes. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} [parameters.perDatabaseSettings] The per database settings + * for the elastic pool. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {number} [parameters.perDatabaseSettings.minCapacity] The minimum + * capacity all databases are guaranteed. + * + * @param {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. * @@ -1712,7 +2211,7 @@ class ElasticPools { } /** - * 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 @@ -1720,27 +2219,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1749,15 +2228,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. */ - updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, 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._deleteMethod(resourceGroupName, serverName, elasticPoolName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1768,7 +2247,7 @@ class ElasticPools { } /** - * 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 @@ -1776,27 +2255,7 @@ class ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -1810,7 +2269,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1818,14 +2277,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. + * {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. */ - update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { + deleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1834,19 +2292,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, serverName, elasticPoolName, 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._deleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); } } /** - * Deletes the 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 @@ -1854,7 +2312,45 @@ 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} 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. * @@ -1863,15 +2359,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. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + updateWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(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); } @@ -1882,7 +2378,7 @@ class ElasticPools { } /** - * Deletes the 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 @@ -1890,7 +2386,45 @@ 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} 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. * @@ -1904,7 +2438,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPool} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1912,13 +2446,14 @@ class ElasticPools { * * {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 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. */ - deleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1927,19 +2462,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(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._deleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._update(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Gets an 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 @@ -1947,8 +2482,47 @@ 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 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. * @@ -1961,11 +2535,11 @@ class ElasticPools { * * @reject {Error} - The error object. */ - getWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { + beginCreateOrUpdateWithHttpOperationResponse(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._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1976,7 +2550,7 @@ class ElasticPools { } /** - * Gets an 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 @@ -1984,8 +2558,47 @@ 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 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. * @@ -2014,7 +2627,7 @@ class ElasticPools { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { + beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2023,19 +2636,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, serverName, elasticPoolName, 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._get(resourceGroupName, serverName, elasticPoolName, options, optionalCallback); + return self._beginCreateOrUpdate(resourceGroupName, serverName, elasticPoolName, parameters, options, optionalCallback); } } /** - * Returns a list of elastic pools in a server. + * 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 @@ -2043,6 +2656,8 @@ class ElasticPools { * * @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 @@ -2050,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. */ - listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, elasticPoolName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, 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); } @@ -2069,7 +2684,7 @@ class ElasticPools { } /** - * Returns a list of elastic pools in a server. + * 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 @@ -2077,6 +2692,8 @@ class ElasticPools { * * @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 @@ -2089,7 +2706,7 @@ class ElasticPools { * * {Promise} A promise is returned * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2097,14 +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 ElasticPoolListResult} 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. */ - listByServer(resourceGroupName, serverName, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, serverName, elasticPoolName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2113,19 +2729,19 @@ class ElasticPools { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByServer(resourceGroupName, serverName, 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._listByServer(resourceGroupName, serverName, 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 @@ -2133,30 +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 {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. * @@ -2169,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); } @@ -2184,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 @@ -2192,30 +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 {object} [parameters.tags] Resource tags. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.location Resource location. + * @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. * @@ -2244,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') { @@ -2253,47 +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. + * Gets all elastic pools in a server. * - * @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} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2302,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); } @@ -2321,35 +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. - * - * @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 {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -2363,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. * @@ -2372,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') { @@ -2387,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/failoverGroups.js b/lib/services/sqlManagement2/lib/operations/failoverGroups.js index 80156eedf9..5b8e881a26 100644 --- a/lib/services/sqlManagement2/lib/operations/failoverGroups.js +++ b/lib/services/sqlManagement2/lib/operations/failoverGroups.js @@ -923,7 +923,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, failoverGroupName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js b/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js index b79462b6d7..0dc60c6b5b 100644 --- a/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js +++ b/lib/services/sqlManagement2/lib/operations/geoBackupPolicies.js @@ -140,7 +140,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -169,7 +169,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -186,7 +186,7 @@ function _createOrUpdate(resourceGroupName, serverName, databaseName, parameters } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index 5554b98d97..c753734bba 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -14,15 +14,16 @@ import * as models from '../models'; /** * @class - * BackupLongTermRetentionPolicies + * RecoverableDatabases * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface BackupLongTermRetentionPolicies { +export interface RecoverableDatabases { /** - * Returns a database backup long term retention policy + * Gets a recoverable database, which is a resource representing a database's + * geo backup * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -30,7 +31,7 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database * * @param {object} [options] Optional Parameters. * @@ -39,14 +40,15 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a database backup long term retention policy + * Gets a recoverable database, which is a resource representing a database's + * geo backup * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -54,7 +56,7 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database * * @param {object} [options] Optional Parameters. * @@ -68,7 +70,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RecoverableDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -76,21 +78,20 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {RecoverableDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link RecoverableDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database backup long term retention policy + * Gets a list of recoverable databases * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -98,17 +99,6 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -116,14 +106,14 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database backup long term retention policy + * Gets a list of recoverable databases * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -131,17 +121,6 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -154,7 +133,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RecoverableDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -162,21 +141,30 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more + * {RecoverableDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RecoverableDatabaseListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RestorableDroppedDatabases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface RestorableDroppedDatabases { /** - * Creates or updates a database backup long term retention policy + * Gets a deleted database that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -184,16 +172,8 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} restorableDroppededDatabaseId The id of the deleted database + * in the form of databaseName,deletionTimeInFileTimeFormat * * @param {object} [options] Optional Parameters. * @@ -202,14 +182,14 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database backup long term retention policy + * Gets a deleted database that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -217,16 +197,8 @@ export interface BackupLongTermRetentionPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * - * @param {object} parameters The required parameters to update a backup long - * term retention policy - * - * @param {string} parameters.state The status of the backup long term - * retention policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} parameters.recoveryServicesBackupPolicyResourceId The azure - * recovery services backup protection policy resource id + * @param {string} restorableDroppededDatabaseId The id of the deleted database + * in the form of databaseName,deletionTimeInFileTimeFormat * * @param {object} [options] Optional Parameters. * @@ -240,7 +212,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {RestorableDroppedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -248,30 +220,21 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more + * {RestorableDroppedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link RestorableDroppedDatabase} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BackupLongTermRetentionVaults - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface BackupLongTermRetentionVaults { + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server backup long term retention vault + * Gets a list of deleted databases that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -286,14 +249,14 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server backup long term retention vault + * Gets a list of deleted databases that can be restored * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -313,7 +276,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {RestorableDroppedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -321,33 +284,35 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more - * information. + * {RestorableDroppedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RestorableDroppedDatabaseListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Servers + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Servers { /** - * Updates a server backup long term retention vault - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Determines whether a resource can be created with the specified name. * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * @param {object} parameters The parameters to request for name availability. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} parameters.name The name whose availability is to be + * checked. * * @param {object} [options] Optional Parameters. * @@ -356,26 +321,19 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server backup long term retention vault - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Determines whether a resource can be created with the specified name. * - * @param {object} parameters The required parameters to update a backup long - * term retention vault + * @param {object} parameters The parameters to request for name availability. * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * @param {string} parameters.name The name whose availability is to be + * checked. * * @param {object} [options] Optional Parameters. * @@ -389,7 +347,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {CheckNameAvailabilityResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -397,33 +355,21 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more + * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. + * See {@link CheckNameAvailabilityResponse} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, callback: ServiceCallback): void; + checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a server backup long term retention vault - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The required parameters to update a backup long - * term retention vault - * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * Gets a list of all servers in the subscription. * * @param {object} [options] Optional Parameters. * @@ -432,26 +378,14 @@ export interface BackupLongTermRetentionVaults { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server backup long term retention vault - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The required parameters to update a backup long - * term retention vault - * - * @param {string} parameters.recoveryServicesVaultResourceId The azure - * recovery services vault resource id + * Gets a list of all servers in the subscription. * * @param {object} [options] Optional Parameters. * @@ -465,7 +399,7 @@ export interface BackupLongTermRetentionVaults { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionVault} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -473,40 +407,25 @@ export interface BackupLongTermRetentionVaults { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionVault} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionVault} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.BackupLongTermRetentionVault, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RestorePoints - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorePoints { + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database restore points. + * Gets a list of servers in a resource groups. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -514,24 +433,19 @@ export interface RestorePoints { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database restore points. + * Gets a list of servers in a resource groups. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -544,7 +458,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePointListResult} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -552,31 +466,20 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePointListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePointListResult} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RecoverableDatabases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RecoverableDatabases { + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a recoverable database, which is a resource representing a database's - * geo backup + * Gets a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -584,8 +487,6 @@ export interface RecoverableDatabases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -593,15 +494,14 @@ export interface RecoverableDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recoverable database, which is a resource representing a database's - * geo backup + * Gets a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -609,8 +509,6 @@ export interface RecoverableDatabases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -623,7 +521,7 @@ export interface RecoverableDatabases { * * {Promise} A promise is returned. * - * @resolve {RecoverableDatabase} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -631,20 +529,20 @@ export interface RecoverableDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecoverableDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link RecoverableDatabase} for more information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of recoverable databases + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -652,21 +550,43 @@ export interface RecoverableDatabases { * * @param {string} serverName The name of the server. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The requested server resource state. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of recoverable databases + * Creates or updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -674,6 +594,28 @@ export interface RecoverableDatabases { * * @param {string} serverName The name of the server. * + * @param {object} parameters The requested server resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -686,7 +628,7 @@ export interface RecoverableDatabases { * * {Promise} A promise is returned. * - * @resolve {RecoverableDatabaseListResult} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -694,30 +636,20 @@ export interface RecoverableDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecoverableDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecoverableDatabaseListResult} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RestorableDroppedDatabases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RestorableDroppedDatabases { + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a deleted database that can be restored + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -725,9 +657,6 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * - * @param {string} restorableDroppededDatabaseId The id of the deleted database - * in the form of databaseName,deletionTimeInFileTimeFormat - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -735,14 +664,14 @@ export interface RestorableDroppedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a deleted database that can be restored + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -750,9 +679,6 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * - * @param {string} restorableDroppededDatabaseId The id of the deleted database - * in the form of databaseName,deletionTimeInFileTimeFormat - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -765,7 +691,7 @@ export interface RestorableDroppedDatabases { * * {Promise} A promise is returned. * - * @resolve {RestorableDroppedDatabase} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -773,21 +699,19 @@ export interface RestorableDroppedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorableDroppedDatabase} [result] - The deserialized result object if an error did not occur. - * See {@link RestorableDroppedDatabase} for more - * information. + * {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, restorableDroppededDatabaseId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, restorableDroppededDatabaseId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of deleted databases that can be restored + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -795,6 +719,18 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -802,14 +738,14 @@ export interface RestorableDroppedDatabases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of deleted databases that can be restored + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -817,6 +753,18 @@ export interface RestorableDroppedDatabases { * * @param {string} serverName The name of the server. * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -829,7 +777,7 @@ export interface RestorableDroppedDatabases { * * {Promise} A promise is returned. * - * @resolve {RestorableDroppedDatabaseListResult} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -837,32 +785,48 @@ export interface RestorableDroppedDatabases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorableDroppedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RestorableDroppedDatabaseListResult} for - * more information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Capabilities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Capabilities { + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the capabilities available for the specified location. + * Creates or updates a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The requested server resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -871,16 +835,42 @@ export interface Capabilities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the capabilities available for the specified location. + * Creates or updates a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. * - * @param {string} locationId The location id whose capabilities are retrieved. + * @param {object} parameters The requested server resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the server. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -894,7 +884,7 @@ export interface Capabilities { * * {Promise} A promise is returned. * - * @resolve {LocationCapabilities} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -902,29 +892,20 @@ export interface Capabilities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. - * See {@link LocationCapabilities} for more information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByLocation(locationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocation(locationId: string, callback: ServiceCallback): void; - listByLocation(locationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerConnectionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerConnectionPolicies { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates the server's connection policy. + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -932,12 +913,6 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for updating a secure - * connection policy. - * - * @param {string} parameters.connectionType The server connection type. - * Possible values include: 'Default', 'Proxy', 'Redirect' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -945,14 +920,14 @@ export interface ServerConnectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates the server's connection policy. + * Deletes a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -960,12 +935,6 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for updating a secure - * connection policy. - * - * @param {string} parameters.connectionType The server connection type. - * Possible values include: 'Default', 'Proxy', 'Redirect' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -978,7 +947,7 @@ export interface ServerConnectionPolicies { * * {Promise} A promise is returned. * - * @resolve {ServerConnectionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -986,21 +955,19 @@ export interface ServerConnectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerConnectionPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the server's secure connection policy. + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1008,6 +975,18 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1015,14 +994,14 @@ export interface ServerConnectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the server's secure connection policy. + * Updates a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1030,6 +1009,18 @@ export interface ServerConnectionPolicies { * * @param {string} serverName The name of the server. * + * @param {object} parameters The requested server resource state. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the server. Once created it cannot be changed. + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for server creation). + * + * @param {string} [parameters.version] The version of the server. + * + * @param {object} [parameters.tags] Resource tags. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1042,7 +1033,7 @@ export interface ServerConnectionPolicies { * * {Promise} A promise is returned. * - * @resolve {ServerConnectionPolicy} - The deserialized result object. + * @resolve {Server} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1050,39 +1041,23 @@ export interface ServerConnectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link ServerConnectionPolicy} for more - * information. + * {Server} [result] - The deserialized result object if an error did not occur. + * See {@link Server} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseThreatDetectionPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseThreatDetectionPolicies { + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * 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. + * Gets a list of all servers in the subscription. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1091,23 +1066,17 @@ export interface DatabaseThreatDetectionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: 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. + * Gets a list of all servers in the subscription. * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1121,7 +1090,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1129,66 +1098,23 @@ export interface DatabaseThreatDetectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database's threat detection policy. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. - * - * @param {object} parameters The database Threat Detection policy. - * - * @param {string} [parameters.location] The geo-location where the resource - * lives - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' - * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. - * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. - * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * Gets a list of servers in a resource groups. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1197,59 +1123,17 @@ 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>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's threat detection policy. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which database - * Threat Detection policy is defined. - * - * @param {object} parameters The database Threat Detection policy. - * - * @param {string} [parameters.location] The geo-location where the resource - * lives - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'New', 'Enabled', 'Disabled' - * - * @param {string} [parameters.disabledAlerts] Specifies the - * semicolon-separated list of alerts that are disabled, or empty string to - * disable no alerts. Possible values: Sql_Injection; - * Sql_Injection_Vulnerability; Access_Anomaly; Usage_Anomaly. - * - * @param {string} [parameters.emailAddresses] Specifies the - * semicolon-separated list of e-mail addresses to which the alert is sent. - * - * @param {string} [parameters.emailAccountAdmins] Specifies that the alert is - * sent to the account administrators. Possible values include: 'Enabled', - * 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage - * will hold all Threat Detection audit logs. If state is Enabled, - * storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the Threat Detection audit storage account. If state is - * Enabled, storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the Threat Detection audit logs. + * Gets a list of servers in a resource groups. * - * @param {string} [parameters.useServerDefault] Specifies whether to use the - * default server policy. Possible values include: 'Enabled', 'Disabled' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1263,7 +1147,7 @@ export interface DatabaseThreatDetectionPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. + * @resolve {ServerListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1271,30 +1155,29 @@ export interface DatabaseThreatDetectionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseSecurityAlertPolicy} for more - * information. + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DataMaskingPolicies + * ServerConnectionPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DataMaskingPolicies { +export interface ServerConnectionPolicies { /** - * Creates or updates a database data masking policy + * Creates or updates the server's connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1302,18 +1185,11 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. - * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' + * @param {object} parameters The required parameters for updating a secure + * connection policy. * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. + * @param {string} parameters.connectionType The server connection type. + * Possible values include: 'Default', 'Proxy', 'Redirect' * * @param {object} [options] Optional Parameters. * @@ -1322,14 +1198,14 @@ export interface DataMaskingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking policy + * Creates or updates the server's connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1337,20 +1213,13 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {object} parameters The required parameters for updating a secure + * connection policy. * - * @param {object} parameters Parameters for creating or updating a data - * masking policy. + * @param {string} parameters.connectionType The server connection type. + * Possible values include: 'Default', 'Proxy', 'Redirect' * - * @param {string} parameters.dataMaskingState The state of the data masking - * policy. Possible values include: 'Disabled', 'Enabled' - * - * @param {string} [parameters.exemptPrincipals] The list of the exempt - * principals. Specifies the semicolon-separated list of database users for - * which the data masking policy does not apply. The specified users receive - * data results without masking for all of the database queries. - * - * @param {object} [options] Optional Parameters. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1362,7 +1231,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {ServerConnectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1370,20 +1239,21 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerConnectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DataMaskingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerConnectionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database data masking policy. + * Gets the server's secure connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1391,8 +1261,6 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1400,14 +1268,14 @@ export interface DataMaskingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database data masking policy. + * Gets the server's secure connection policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1415,8 +1283,6 @@ export interface DataMaskingPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1429,7 +1295,7 @@ export interface DataMaskingPolicies { * * {Promise} A promise is returned. * - * @resolve {DataMaskingPolicy} - The deserialized result object. + * @resolve {ServerConnectionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1437,29 +1303,30 @@ export interface DataMaskingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DataMaskingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DataMaskingPolicy} for more information. + * {ServerConnectionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link ServerConnectionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DataMaskingRules + * DatabaseThreatDetectionPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DataMaskingRules { +export interface DatabaseThreatDetectionPolicies { /** - * Creates or updates a database data masking rule. + * 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 @@ -1467,55 +1334,8 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} dataMaskingRuleName The name of the data masking rule. - * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. - * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. - * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. - * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. - * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. - * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' - * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. * * @param {object} [options] Optional Parameters. * @@ -1524,14 +1344,14 @@ export interface DataMaskingRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database data masking rule. + * 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 @@ -1539,55 +1359,8 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. - * - * @param {string} dataMaskingRuleName The name of the data masking rule. - * - * @param {object} parameters The required parameters for creating or updating - * a data masking rule. - * - * @param {string} [parameters.aliasName] The alias name. This is a legacy - * parameter and is no longer used. - * - * @param {string} [parameters.ruleState] The rule state. Used to delete a - * rule. To delete an existing rule, specify the schemaName, tableName, - * columnName, maskingFunction, and specify ruleState as disabled. However, if - * the rule doesn't already exist, the rule will be created with ruleState set - * to enabled, regardless of the provided value of ruleState. Possible values - * include: 'Disabled', 'Enabled' - * - * @param {string} parameters.schemaName The schema name on which the data - * masking rule is applied. - * - * @param {string} parameters.tableName The table name on which the data - * masking rule is applied. - * - * @param {string} parameters.columnName The column name on which the data - * masking rule is applied. - * - * @param {string} parameters.maskingFunction The masking function that is used - * for the data masking rule. Possible values include: 'Default', 'CCN', - * 'Email', 'Number', 'SSN', 'Text' - * - * @param {string} [parameters.numberFrom] The numberFrom property of the - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.numberTo] The numberTo property of the data - * masking rule. Required if maskingFunction is set to Number, otherwise this - * parameter will be ignored. - * - * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked in the beginning of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, - * the number of characters to show unmasked at the end of the string. - * Otherwise, this parameter will be ignored. - * - * @param {string} [parameters.replacementString] If maskingFunction is set to - * Text, the character to use for masking the unexposed part of the string. - * Otherwise, this parameter will be ignored. + * @param {string} databaseName The name of the database for which database + * Threat Detection policy is defined. * * @param {object} [options] Optional Parameters. * @@ -1601,7 +1374,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRule} - The deserialized result object. + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1609,20 +1382,21 @@ 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. + * {DatabaseSecurityAlertPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseSecurityAlertPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, 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; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of database data masking rules. + * 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 @@ -1630,7 +1404,44 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database 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. * @@ -1639,14 +1450,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseSecurityAlertPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database data masking rules. + * 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 @@ -1654,7 +1465,44 @@ export interface DataMaskingRules { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} databaseName The name of the database 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. * @@ -1668,7 +1516,7 @@ export interface DataMaskingRules { * * {Promise} A promise is returned. * - * @resolve {DataMaskingRuleListResult} - The deserialized result object. + * @resolve {DatabaseSecurityAlertPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1676,30 +1524,30 @@ 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 + * {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. */ - 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; + 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 - * FirewallRules + * DataMaskingPolicies * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface FirewallRules { +export interface DataMaskingPolicies { /** - * Creates or updates a firewall rule. + * 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 @@ -1707,18 +1555,18 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * @param {object} parameters Parameters for creating or updating a data + * masking policy. * - * @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.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' * - * @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.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. * @@ -1727,14 +1575,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, databaseName: string, parameters: models.DataMaskingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a firewall rule. + * 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 @@ -1742,18 +1590,18 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for creating or updating - * a firewall rule. + * @param {object} parameters Parameters for creating or updating a data + * masking policy. * - * @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.dataMaskingState The state of the data masking + * policy. Possible values include: 'Disabled', 'Enabled' * - * @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.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. * @@ -1767,7 +1615,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {DataMaskingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1775,20 +1623,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. + * {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, 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, 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; /** - * Deletes a firewall rule. + * 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 @@ -1796,7 +1644,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1805,14 +1653,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a firewall rule. + * 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 @@ -1820,7 +1668,7 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -1834,7 +1682,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DataMaskingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1842,19 +1690,29 @@ export interface FirewallRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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 { /** - * Gets a firewall rule. + * Creates or updates a database data masking rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1862,7 +1720,55 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. + * + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. + * + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. + * + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. + * + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. + * + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. + * + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' + * + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. * * @param {object} [options] Optional Parameters. * @@ -1871,14 +1777,14 @@ export interface FirewallRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, dataMaskingRuleName: string, parameters: models.DataMaskingRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a firewall rule. + * Creates or updates a database data masking rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -1886,7 +1792,55 @@ export interface FirewallRules { * * @param {string} serverName The name of the server. * - * @param {string} firewallRuleName The name of the firewall rule. + * @param {string} databaseName The name of the database. + * + * @param {string} dataMaskingRuleName The name of the data masking rule. + * + * @param {object} parameters The required parameters for creating or updating + * a data masking rule. + * + * @param {string} [parameters.aliasName] The alias name. This is a legacy + * parameter and is no longer used. + * + * @param {string} [parameters.ruleState] The rule state. Used to delete a + * rule. To delete an existing rule, specify the schemaName, tableName, + * columnName, maskingFunction, and specify ruleState as disabled. However, if + * the rule doesn't already exist, the rule will be created with ruleState set + * to enabled, regardless of the provided value of ruleState. Possible values + * include: 'Disabled', 'Enabled' + * + * @param {string} parameters.schemaName The schema name on which the data + * masking rule is applied. + * + * @param {string} parameters.tableName The table name on which the data + * masking rule is applied. + * + * @param {string} parameters.columnName The column name on which the data + * masking rule is applied. + * + * @param {string} parameters.maskingFunction The masking function that is used + * for the data masking rule. Possible values include: 'Default', 'CCN', + * 'Email', 'Number', 'SSN', 'Text' + * + * @param {string} [parameters.numberFrom] The numberFrom property of the + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.numberTo] The numberTo property of the data + * masking rule. Required if maskingFunction is set to Number, otherwise this + * parameter will be ignored. + * + * @param {string} [parameters.prefixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked in the beginning of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.suffixSize] If maskingFunction is set to Text, + * the number of characters to show unmasked at the end of the string. + * Otherwise, this parameter will be ignored. + * + * @param {string} [parameters.replacementString] If maskingFunction is set to + * Text, the character to use for masking the unexposed part of the string. + * Otherwise, this parameter will be ignored. * * @param {object} [options] Optional Parameters. * @@ -1900,7 +1854,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRule} - The deserialized result object. + * @resolve {DataMaskingRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1908,20 +1862,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. + * {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. */ - 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; + 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; /** - * Returns a list of firewall rules. + * 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 @@ -1929,6 +1883,8 @@ export interface FirewallRules { * * @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 @@ -1936,14 +1892,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>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of firewall rules. + * 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 @@ -1951,6 +1907,8 @@ export interface FirewallRules { * * @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 @@ -1963,7 +1921,7 @@ export interface FirewallRules { * * {Promise} A promise is returned. * - * @resolve {FirewallRuleListResult} - The deserialized result object. + * @resolve {DataMaskingRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -1971,30 +1929,30 @@ 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 + * {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. */ - 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; + 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 - * GeoBackupPolicies + * FirewallRules * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface GeoBackupPolicies { +export interface FirewallRules { /** - * Updates a database geo backup policy. + * 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 @@ -2002,13 +1960,18 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. + * a firewall rule. * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @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. * @@ -2017,14 +1980,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, parameters: models.FirewallRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a database geo backup policy. + * 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 @@ -2032,13 +1995,18 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} parameters The required parameters for creating or updating - * the geo backup policy. + * a firewall rule. * - * @param {string} parameters.state The state of the geo backup policy. - * Possible values include: 'Disabled', 'Enabled' + * @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. * @@ -2052,7 +2020,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2060,20 +2028,20 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {FirewallRule} [result] - The deserialized result object if an error did not occur. + * See {@link FirewallRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.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; + 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; /** - * Gets a geo backup policy. + * 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 @@ -2081,7 +2049,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2090,14 +2058,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a geo backup policy. + * 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 @@ -2105,7 +2073,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2119,7 +2087,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2127,20 +2095,19 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicy} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, firewallRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of geo backup policies. + * 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 @@ -2148,7 +2115,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2157,14 +2124,14 @@ export interface GeoBackupPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, firewallRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of geo backup policies. + * 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 @@ -2172,7 +2139,7 @@ export interface GeoBackupPolicies { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} firewallRuleName The name of the firewall rule. * * @param {object} [options] Optional Parameters. * @@ -2186,7 +2153,7 @@ export interface GeoBackupPolicies { * * {Promise} A promise is returned. * - * @resolve {GeoBackupPolicyListResult} - The deserialized result object. + * @resolve {FirewallRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2194,30 +2161,20 @@ export interface GeoBackupPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {GeoBackupPolicyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link GeoBackupPolicyListResult} for more - * information. + * {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. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Databases - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Databases { + get(resourceGroupName: string, serverName: string, 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; /** - * Imports a bacpac into a new database. + * Returns a list of firewall rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2225,40 +2182,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2266,14 +2189,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Imports a bacpac into a new database. + * Returns a list of firewall rules. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -2281,40 +2204,6 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' - * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2327,7 +2216,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {FirewallRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2335,21 +2224,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * {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. */ - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; - importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * GeoBackupPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface GeoBackupPolicies { /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * 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 @@ -2357,31 +2255,13 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * * @param {object} [options] Optional Parameters. * @@ -2390,15 +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. */ - createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.GeoBackupPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Updates 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 @@ -2406,31 +2285,13 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into - * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} [parameters.name] The name of the extension. - * - * @param {string} [parameters.type] The type of the extension. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {object} parameters The required parameters for creating or updating + * the geo backup policy. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} parameters.state The state of the geo backup policy. + * Possible values include: 'Disabled', 'Enabled' * * @param {object} [options] Optional Parameters. * @@ -2444,7 +2305,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2452,20 +2313,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. + * {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. */ - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; - createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Exports a database to a bacpac. + * 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 @@ -2473,26 +2334,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2501,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. */ - exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Exports a database to a bacpac. + * 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 @@ -2516,26 +2358,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -2549,7 +2372,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {GeoBackupPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2557,20 +2380,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. + * {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. */ - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; - exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 database metrics. + * 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 @@ -2580,9 +2403,6 @@ export interface Databases { * * @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 @@ -2590,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. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metrics. + * 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 @@ -2607,9 +2427,6 @@ export interface Databases { * * @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 @@ -2622,7 +2439,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {GeoBackupPolicyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2630,20 +2447,30 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {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. */ - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 { /** - * Returns database metric definitions. + * 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 @@ -2651,7 +2478,47 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @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. * @@ -2660,14 +2527,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + importMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database metric definitions. + * 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 @@ -2675,7 +2542,47 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @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. * @@ -2689,7 +2596,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2697,21 +2604,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {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. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; + importMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Pauses 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 @@ -2719,7 +2626,31 @@ 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 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. * @@ -2728,14 +2659,15 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses 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 @@ -2743,7 +2675,31 @@ 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 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. * @@ -2757,7 +2713,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2765,19 +2721,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. + * {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. */ - 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; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; + createImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Resumes a data warehouse. + * 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 @@ -2785,23 +2742,42 @@ 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 to be exported. * - * @param {object} [options] Optional Parameters. + * @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. + * @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>; + exportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * 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 @@ -2809,7 +2785,26 @@ 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 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. * @@ -2823,7 +2818,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ImportExportResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2831,19 +2826,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. + * {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. */ - 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; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; + exportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new database or updates an existing 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 @@ -2851,130 +2847,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.location Resource location. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -2983,14 +2859,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>; + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing 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 @@ -2998,130 +2874,10 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be operated on - * (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * a database. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database. * - * @param {string} parameters.location Resource location. + * @param {string} filter An OData filter expression that describes a subset of + * metrics to return. * * @param {object} [options] Optional Parameters. * @@ -3135,7 +2891,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {MetricListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3143,20 +2899,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. + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, databaseName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing 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 @@ -3164,126 +2920,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3292,14 +2929,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing 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 @@ -3307,126 +2944,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. - * - * @param {object} parameters The required parameters for updating a database. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. - * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. - * - * Default: regular database creation. - * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. - * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. - * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. - * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. - * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. - * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. - * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -3440,7 +2958,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {MetricDefinitionListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3448,20 +2966,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes 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 @@ -3469,7 +2988,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 to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3482,10 +3001,10 @@ export interface Databases { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + upgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes 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 @@ -3493,7 +3012,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 to be upgraded. * * @param {object} [options] Optional Parameters. * @@ -3521,13 +3040,13 @@ export interface Databases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Gets a 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 @@ -3535,27 +3054,21 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database. + * 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 @@ -3563,14 +3076,8 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be retrieved. - * * @param {object} [options] Optional Parameters. * - * @param {string} [options.expand] A comma separated list of child objects to - * expand in the response. Possible properties: serviceTierAdvisors, - * transparentDataEncryption. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3581,7 +3088,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3589,20 +3096,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. + * {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, databaseName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a list of databases in a server. + * 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 @@ -3610,28 +3117,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} databaseName The name of the database. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in a server. + * 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 @@ -3639,14 +3141,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} databaseName The name of the database. * - * @param {string} [options.filter] An OData filter expression that describes a - * subset of databases to return. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -3658,7 +3155,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {Database} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3666,20 +3163,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. + * {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. */ - listByServer(resourceGroupName: string, serverName: string, options?: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { expand? : string, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database inside of an 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 @@ -3687,81 +3184,119 @@ 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 {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. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @reject {Error|ServiceError} - The error object. - */ - getByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database inside of an elastic pool. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * Default: regular database creation. * - * @param {string} databaseName The name of the database to be retrieved. + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * {Promise} A promise is returned. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @resolve {Database} - The deserialized result object. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.collation] The collation of the database. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, callback: ServiceCallback): void; - getByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns a list of databases in an elastic pool. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @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. * @@ -3770,14 +3305,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of databases in an 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 @@ -3785,81 +3320,119 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} databaseName The name of the database. * - * @param {object} [options] Optional Parameters. + * @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. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * {Promise} A promise is returned. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @resolve {DatabaseListResult} - The deserialized result object. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @reject {Error|ServiceError} - The error object. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * Default: regular database creation. * - * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseListResult} for more information. + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * 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. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a database inside of a recommented elastic pool. + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @param {string} serverName The name of the server. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * 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 retrieved. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.collation] The collation of the database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @reject {Error|ServiceError} - The error object. - */ - getByRecommendedElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a database inside of a recommented elastic pool. + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {date} [parameters.restorePointInTime] Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} serverName The name of the server. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. + * + * @param {string} [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} recommendedElasticPoolName The name of the elastic pool to - * be retrieved. + * @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} databaseName The name of the database to be retrieved. + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -3888,13 +3461,13 @@ export interface Databases { * * {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; + 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; /** - * 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 @@ -3902,8 +3475,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. * @@ -3912,14 +3484,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>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 @@ -3927,8 +3499,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. * @@ -3942,7 +3513,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {DatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3950,20 +3521,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. */ - 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; + 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; /** - * 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 @@ -3971,131 +3541,133 @@ 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} 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', '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: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', '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. * - * @returns {Promise} A promise is returned + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @reject {Error|ServiceError} - The error object. - */ - beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Imports a bacpac into a new 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} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} serverName The name of the server. + * @param {string} [parameters.collation] The collation of the database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. - * - * @param {string} parameters.databaseName The name of the database to import. - * - * @param {string} parameters.edition The edition for the database being - * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', - * 'Premium', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} parameters.serviceObjectiveName The name of the service - * objective to assign to the database. Possible values include: 'Basic', 'S0', - * 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'System', - * 'System2', 'ElasticPool' + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} parameters.maxSizeBytes The maximum size for the newly - * imported 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} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing 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.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. * - * @param {string} parameters.storageUri The storage uri to use. + * @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.administratorLogin The name of the SQL - * administrator. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.recoverableDatabaseId] The resource identifier + * of the recoverable database associated with create operation of this + * database. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.restorableDroppedDatabaseId] The resource + * identifier of the restorable dropped database associated with create + * operation of this database. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @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. * - * {Promise} A promise is returned. + * @param {string} [parameters.licenseType] The license type to apply for this + * database. Possible values include: 'LicenseIncluded', 'BasePrice' * - * @resolve {ImportExportResponse} - The deserialized result object. + * @param {string} [parameters.readScale] The state of read-only routing. If + * enabled, connections that have application intent set to readonly in their + * connection string may be routed to a readonly secondary replica in the same + * region. Possible values include: 'Enabled', 'Disabled' * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.tags] Resource tags. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [options] Optional Parameters. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. - * See {@link ImportExportResponse} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - 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; - + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4103,80 +3675,117 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to import into + * @param {string} databaseName The name of the database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {object} parameters The requested database resource state. * - * @param {string} [parameters.name] The name of the extension. + * @param {object} [parameters.sku] The name and tier of the SKU. * - * @param {string} [parameters.type] The type of the extension. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @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.size] Size of the particular SKU * - * @param {string} parameters.storageUri The storage uri to use. + * @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.administratorLogin The name of the SQL - * administrator. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * 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 + * 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 {Promise} A promise is returned + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates an import operation that imports a bacpac into an existing database. - * The existing database must be empty. + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. * - * @param {string} serverName The name of the server. + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' * - * @param {string} databaseName The name of the database to import into + * @param {string} [parameters.collation] The collation of the database. * - * @param {object} parameters The required parameters for importing a Bacpac - * into a database. + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. * - * @param {string} [parameters.name] The name of the extension. + * @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.type] The type of the extension. + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database 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 {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.storageUri The storage uri to use. + * @param {date} [parameters.sourceDatabaseDeletionDate] Specifies the time + * that the database was deleted. * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. + * @param {string} [parameters.recoveryServicesRecoveryPointId] The resource + * identifier of the recovery point associated with create operation of this + * database. * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. + * @param {string} [parameters.longTermRetentionBackupResourceId] The resource + * identifier of the long term retention backup associated with create + * operation of this database. * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @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. * @@ -4190,7 +3799,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. * @@ -4198,20 +3807,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. */ - 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; + 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; /** - * 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 @@ -4219,26 +3828,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -4247,14 +3837,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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 @@ -4262,26 +3852,7 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be exported. - * - * @param {object} parameters The required parameters for exporting a database. - * - * @param {string} parameters.storageKeyType The type of the storage key to - * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' - * - * @param {string} parameters.storageKey The storage key to use. If storage - * key type is SharedAccessKey, it must be preceded with a "?." - * - * @param {string} parameters.storageUri The storage uri to use. - * - * @param {string} parameters.administratorLogin The name of the SQL - * administrator. - * - * @param {string} parameters.administratorLoginPassword The password of the - * SQL administrator. - * - * @param {string} [parameters.authenticationType] The authentication type. - * Possible values include: 'SQL', 'ADPassword' + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -4295,7 +3866,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {ImportExportResponse} - The deserialized result object. + * @resolve {DatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4303,20 +3874,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. + * {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. */ - 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; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Pauses a data warehouse. + * 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 @@ -4324,7 +3895,7 @@ 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 to be paused. * * @param {object} [options] Optional Parameters. * @@ -4333,14 +3904,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>; + pauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Pauses a data warehouse. + * 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 @@ -4348,7 +3919,7 @@ 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 to be paused. * * @param {object} [options] Optional Parameters. * @@ -4362,7 +3933,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. * @@ -4370,19 +3941,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Resumes a data warehouse. + * 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 @@ -4390,7 +3962,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 to be resumed. * * @param {object} [options] Optional Parameters. * @@ -4399,14 +3971,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>; + resumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Resumes a data warehouse. + * 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 @@ -4414,7 +3986,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 to be resumed. * * @param {object} [options] Optional Parameters. * @@ -4428,7 +4000,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. * @@ -4436,19 +4008,20 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 a new database or updates an existing database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4456,130 +4029,12 @@ 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. + * @param {string} databaseName The name of the database to rename. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' - * - * @param {object} [parameters.tags] Resource tags. + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {string} parameters.location Resource location. + * @param {string} parameters.id The target ID for the resource * * @param {object} [options] Optional Parameters. * @@ -4588,14 +4043,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + renameWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new database or updates an existing database. + * Renames a database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4603,130 +4058,3216 @@ 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 to rename. * - * @param {object} parameters The required parameters for creating or updating - * a database. + * @param {object} parameters The resource move definition for renaming this + * database. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @param {string} parameters.id The target ID for the resource * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, callback: ServiceCallback): void; + rename(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ResourceMoveDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Imports a bacpac into a new database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginImportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Imports a bacpac into a new database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} parameters.databaseName The name of the database to import. + * + * @param {string} parameters.edition The edition for the database being + * created. Possible values include: 'Web', 'Business', 'Basic', 'Standard', + * 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', + * 'System2' + * + * @param {string} parameters.serviceObjectiveName The name of the service + * objective to assign to the database. Possible values include: 'System', + * 'System0', 'System1', 'System2', 'System3', 'System4', 'System2L', + * 'System3L', 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', + * 'S7', 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', + * 'PRS2', 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', + * 'DW600', 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', + * 'DW2000c', 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', + * 'DW7500c', 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', + * 'DS400', 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', + * 'ElasticPool' + * + * @param {string} parameters.maxSizeBytes The maximum size for the newly + * imported database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, callback: ServiceCallback): void; + beginImportMethod(resourceGroupName: string, serverName: string, parameters: models.ImportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateImportOperationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates an import operation that imports a bacpac into an existing database. + * The existing database must be empty. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to import into + * + * @param {object} parameters The required parameters for importing a Bacpac + * into a database. + * + * @param {string} [parameters.name] The name of the extension. + * + * @param {string} [parameters.type] The type of the extension. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, callback: ServiceCallback): void; + beginCreateImportOperation(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ImportExtensionRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Exports a database to a bacpac. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginExportMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Exports a database to a bacpac. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be exported. + * + * @param {object} parameters The required parameters for exporting a database. + * + * @param {string} parameters.storageKeyType The type of the storage key to + * use. Possible values include: 'StorageAccessKey', 'SharedAccessKey' + * + * @param {string} parameters.storageKey The storage key to use. If storage + * key type is SharedAccessKey, it must be preceded with a "?." + * + * @param {string} parameters.storageUri The storage uri to use. + * + * @param {string} parameters.administratorLogin The name of the SQL + * administrator. + * + * @param {string} parameters.administratorLoginPassword The password of the + * SQL administrator. + * + * @param {string} [parameters.authenticationType] The authentication type. + * Possible values include: 'SQL', 'ADPassword' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ImportExportResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ImportExportResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ImportExportResponse} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, callback: ServiceCallback): void; + beginExportMethod(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.ExportRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Upgrades a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be upgraded. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpgradeDataWarehouseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Upgrades a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be upgraded. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginUpgradeDataWarehouse(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @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. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.Database, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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. + */ + beginDeleteMethodWithHttpOperationResponse(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. + */ + 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; + + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {object} [parameters.sku] The name and tier of the SKU. + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.createMode] Specifies the mode of database + * creation. + * + * Default: regular database creation. + * + * Copy: creates a database as a copy of an existing database. sourceDatabaseId + * must be specified as the resource ID of the source database. + * + * Secondary: creates a database as a secondary replica of an existing + * database. sourceDatabaseId must be specified as the resource ID of the + * existing primary database. + * + * PointInTimeRestore: Creates a database by restoring a point in time backup + * of an existing database. sourceDatabaseId must be specified as the resource + * ID of the existing database, and restorePointInTime must be specified. + * + * Recovery: Creates a database by restoring a geo-replicated backup. + * sourceDatabaseId must be specified as the recoverable database resource ID + * to restore. + * + * Restore: Creates a database by restoring a backup of a deleted database. + * sourceDatabaseId must be specified. If sourceDatabaseId is the database's + * original resource ID, then sourceDatabaseDeletionDate must be specified. + * Otherwise sourceDatabaseId must be the restorable dropped database resource + * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be + * specified to restore from an earlier point in time. + * + * RestoreLongTermRetentionBackup: Creates a database by restoring from a long + * term retention vault. recoveryServicesRecoveryPointResourceId must be + * specified as the recovery point resource ID. + * + * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for + * DataWarehouse edition. Possible values include: 'Default', 'Copy', + * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', + * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', + * 'RestoreLongTermRetentionBackup', 'OnlineSecondary' + * + * @param {string} [parameters.collation] The collation of the database. + * + * @param {number} [parameters.maxSizeBytes] The max size of the database + * expressed in bytes. + * + * @param {string} [parameters.sampleName] The name of the sample schema to + * apply when creating this database. Possible values include: + * 'AdventureWorksLT', 'WideWorldImportersStd', 'WideWorldImportersFull' + * + * @param {string} [parameters.elasticPoolId] The resource identifier of the + * elastic pool containing this database. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Pauses a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be paused. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginPauseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Pauses a database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to be paused. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginPause(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Resumes a 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginResumeWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Resumes a 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Database} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Database} [result] - The deserialized result object if an error did not occur. + * See {@link Database} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + beginResume(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DatabaseListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + 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 { + + + /** + * 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|ServiceError} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MetricListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MetricListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns 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|ServiceError} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns elastic pool metric definitions. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MetricDefinitionListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinitionListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * 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|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { skip? : number, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {ElasticPoolListResult} - 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. + * + * {ElasticPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { 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; + + + /** + * 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|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * + * @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 {ElasticPool} - 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. + * + * {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, 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 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates 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 {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 {ElasticPool} - 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. + * + * {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, 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 an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {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, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an 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 + * + * @returns {Promise} A promise is returned + * + * @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>; + + /** + * 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 {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 {ElasticPool} - 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. + * + * {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. + */ + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates 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 + * + * @returns {Promise} A promise is returned + * + * @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>; + + /** + * 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 {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 {ElasticPool} - 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. + * + * {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. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes an elastic pool. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} elasticPoolName The name of the elastic pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, 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; + + + /** + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * 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 {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 {ElasticPool} - 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. + * + * {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. + */ + 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; + + + /** + * 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets 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 {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 {ElasticPoolListResult} - 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. + * + * {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. + */ + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RecommendedElasticPools + * __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 + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ReplicationLinks { + + + /** + * Deletes a database replication link. Cannot be done during failover. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be dropped. + * + * @param {string} linkId The ID of the replication link to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a database replication link. Cannot be done during failover. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be dropped. + * + * @param {string} linkId The ID of the replication link to be deleted. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a database replication link. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to get the link for. + * + * @param {string} linkId The replication link ID to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database replication link. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to get the link for. + * + * @param {string} linkId The replication link ID to be retrieved. + * + * @param {object} [options] Optional Parameters. + * + * @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 {ReplicationLink} - 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. + * + * {ReplicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicationLink} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @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. + */ + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + failoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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. + */ + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists a database's replication links. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to retrieve links for. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists a database's replication links. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database to retrieve links for. + * + * @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 {ReplicationLinkListResult} - 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. + * + * {ReplicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ReplicationLinkListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + 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; + + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @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. + */ + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. + * + * @param {string} linkId The ID of the replication link to be failed over. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets which replica database is primary by failing over from the current + * primary replica database. This operation might result in data loss. * - * Default: regular database creation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} serverName The name of the server. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {string} databaseName The name of the database that has the + * replication link to be failed over. * - * 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} linkId The ID of the replication link to be failed over. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {object} [options] Optional Parameters. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @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. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * {Promise} A promise is returned. * - * @param {object} [parameters.tags] Resource tags. + * @resolve {null} - The deserialized result object. * - * @param {string} parameters.location Resource location. + * @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. + */ + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; + beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerAzureADAdministrators + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerAzureADAdministrators { + + + /** + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. + * + * @param {string} properties.login The server administrator login value. + * + * @param {uuid} properties.sid The server administrator Sid (Secure ID). + * + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. + * + * @param {string} properties.login The server administrator login value. + * + * @param {uuid} properties.sid The server administrator Sid (Secure ID). + * + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * * @param {object} [options] Optional Parameters. * @@ -4740,7 +7281,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -4748,20 +7289,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing database. + * Deletes an existing server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4769,126 +7311,133 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.tags] Resource tags. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes an existing server Active Directory Administrator. * - * Default: regular database creation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @param {string} serverName The name of the server. * - * OnlineSecondary/NonReadableSecondary: creates a database as a (readable or - * nonreadable) secondary replica of an existing database. sourceDatabaseId - * must be specified as the resource ID of the existing primary database. + * @param {object} [options] Optional Parameters. * - * PointInTimeRestore: Creates a database by restoring a point in time backup - * of an existing database. sourceDatabaseId must be specified as the resource - * ID of the existing database, and restorePointInTime must be specified. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * Restore: Creates a database by restoring a backup of a deleted database. - * sourceDatabaseId must be specified. If sourceDatabaseId is the database's - * original resource ID, then sourceDatabaseDeletionDate must be specified. - * Otherwise sourceDatabaseId must be the restorable dropped database resource - * ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be - * specified to restore from an earlier point in time. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServerAzureADAdministrator} - 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. + * + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns an server Administrator. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * 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. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Returns an server Administrator. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * 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 {ServerAzureADAdministrator} - 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. + * + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Returns a list of server Administrators. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' - * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. - * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. - * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. - * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. - * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' - * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." - * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' - * - * @param {string} [parameters.elasticPoolName] The name of the elastic pool - * the database is in. If elasticPoolName and requestedServiceObjectiveName are - * both updated, the value of requestedServiceObjectiveName is ignored. Not - * supported for DataWarehouse edition. - * - * @param {string} [parameters.readScale] Conditional. If the database is a - * geo-secondary, readScale indicates whether read-only connections are allowed - * to this database or not. Not supported for DataWarehouse edition. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.sampleName] Indicates the name of the sample - * schema to apply when creating this database. If createMode is not Default, - * this value is ignored. Not supported for DataWarehouse edition. Possible - * values include: 'AdventureWorksLT' + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -4897,14 +7446,14 @@ export interface Databases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing database. + * Returns a list of server Administrators. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -4912,126 +7461,91 @@ export interface Databases { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to be updated. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The required parameters for updating a database. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.tags] Resource tags. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.collation] The collation of the database. If - * createMode is not Default, this value is ignored. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} [parameters.createMode] Specifies the mode of database - * creation. + * {Promise} A promise is returned. * - * Default: regular database creation. + * @resolve {ServerAdministratorListResult} - The deserialized result object. * - * Copy: creates a database as a copy of an existing database. sourceDatabaseId - * must be specified as the resource ID of the source database. + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) * - * 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. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * 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. + * {ServerAdministratorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAdministratorListResult} for more + * information. * - * Recovery: Creates a database by restoring a geo-replicated backup. - * sourceDatabaseId must be specified as the recoverable database resource ID - * to restore. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * 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. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * - * RestoreLongTermRetentionBackup: Creates a database by restoring from a long - * term retention vault. recoveryServicesRecoveryPointResourceId must be - * specified as the recovery point resource ID. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. + * + * @param {string} properties.login The server administrator login value. + * + * @param {uuid} properties.sid The server administrator Sid (Secure ID). * - * Copy, NonReadableSecondary, OnlineSecondary and - * RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. - * Possible values include: 'Copy', 'Default', 'NonReadableSecondary', - * 'OnlineSecondary', 'PointInTimeRestore', 'Recovery', 'Restore', - * 'RestoreLongTermRetentionBackup' + * @param {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * - * @param {string} [parameters.sourceDatabaseId] Conditional. If createMode is - * Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, - * or Restore, then this value is required. Specifies the resource ID of the - * source database. If createMode is NonReadableSecondary or OnlineSecondary, - * the name of the source database must be the same as the new database being - * created. + * @param {object} [options] Optional Parameters. * - * @param {date} [parameters.sourceDatabaseDeletionDate] Conditional. If - * createMode is Restore and sourceDatabaseId is the deleted database's - * original resource id when it existed (as opposed to its current restorable - * dropped database id), then this value is required. Specifies the time that - * the database was deleted. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {date} [parameters.restorePointInTime] Conditional. If createMode is - * PointInTimeRestore, this value is required. If createMode is Restore, this - * value is optional. Specifies the point in time (ISO8601 format) of the - * source database that will be restored to create the new database. Must be - * greater than or equal to the source database's earliestRestoreDate value. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.recoveryServicesRecoveryPointResourceId] - * Conditional. If createMode is RestoreLongTermRetentionBackup, then this - * value is required. Specifies the resource ID of the recovery point to - * restore from. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.edition] The edition of the database. The - * DatabaseEditions enumeration contains all the valid editions. If createMode - * is NonReadableSecondary or OnlineSecondary, this value is ignored. To see - * possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'Free', - * 'Stretch', 'DataWarehouse', 'System', 'System2' + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a new Server Active Directory Administrator or updates an existing + * server Active Directory Administrator. * - * @param {string} [parameters.maxSizeBytes] The max size of the database - * expressed in bytes. If createMode is not Default, this value is ignored. To - * see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {uuid} [parameters.requestedServiceObjectiveId] The configured - * service level objective ID of the database. This is the service level - * objective that is in the process of being applied to the database. Once - * successfully updated, it will match the value of currentServiceObjectiveId - * property. If requestedServiceObjectiveId and requestedServiceObjectiveName - * are both updated, the value of requestedServiceObjectiveId overrides the - * value of requestedServiceObjectiveName. To see possible values, query the - * capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation." + * @param {string} serverName The name of the server. * - * @param {string} [parameters.requestedServiceObjectiveName] The name of the - * configured service level objective of the database. This is the service - * level objective that is in the process of being applied to the database. - * Once successfully updated, it will match the value of serviceLevelObjective - * property. To see possible values, query the capabilities API - * (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) - * referred to by operationId: "Capabilities_ListByLocation.". Possible values - * include: 'Basic', 'S0', 'S1', 'S2', 'S3', 'P1', 'P2', 'P3', 'P4', 'P6', - * 'P11', 'P15', 'System', 'System2', 'ElasticPool' + * @param {object} properties The required parameters for creating or updating + * an Active Directory Administrator. * - * @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} properties.login The server administrator login value. * - * @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 {uuid} properties.sid The server administrator Sid (Secure ID). * - * @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 {uuid} properties.tenantId The server Active Directory Administrator + * tenant id. * * @param {object} [options] Optional Parameters. * @@ -5045,7 +7559,7 @@ export interface Databases { * * {Promise} A promise is returned. * - * @resolve {Database} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5053,29 +7567,21 @@ export interface Databases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Database} [result] - The deserialized result object if an error did not occur. - * See {@link Database} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPools { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns elastic pool metrics. + * Deletes an existing server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5083,11 +7589,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5095,14 +7596,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metrics. + * Deletes an existing server Active Directory Administrator. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5110,11 +7611,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. - * - * @param {string} filter An OData filter expression that describes a subset of - * metrics to return. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5127,7 +7623,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricListResult} - The deserialized result object. + * @resolve {ServerAzureADAdministrator} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5135,20 +7631,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricListResult} for more information. + * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAzureADAdministrator} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, elasticPoolName: string, filter: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerCommunicationLinks + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerCommunicationLinks { /** - * Returns elastic pool metric definitions. + * Deletes a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5156,7 +7662,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -5165,14 +7672,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool metric definitions. + * Deletes a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5180,7 +7687,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -5194,7 +7702,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {MetricDefinitionListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5202,21 +7710,19 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {MetricDefinitionListResult} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionListResult} for more - * information. + * {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. */ - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5224,30 +7730,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -5256,14 +7740,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5271,30 +7755,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. + * @param {string} communicationLinkName The name of the server communication + * link. * * @param {object} [options] Optional Parameters. * @@ -5308,7 +7770,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5316,20 +7778,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing elastic pool. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5337,27 +7800,13 @@ 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 {string} communicationLinkName The name of the server communication + * link. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} parameters The required parameters for creating a server + * communication link. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5366,14 +7815,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>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5381,27 +7830,13 @@ 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 {string} communicationLinkName The name of the server communication + * link. * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. + * @param {object} parameters The required parameters for creating a server + * communication link. * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5415,7 +7850,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5423,20 +7858,21 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the elastic pool. + * Gets a list of server communication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5444,8 +7880,6 @@ export interface ElasticPools { * * @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 @@ -5453,14 +7887,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>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the elastic pool. + * Gets a list of server communication links. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5468,8 +7902,6 @@ export interface ElasticPools { * * @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 @@ -5482,7 +7914,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5490,19 +7922,21 @@ 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. + * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLinkListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets an elastic pool. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5510,8 +7944,13 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5520,14 +7959,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets an elastic pool. + * Creates a server communication link. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5535,8 +7974,13 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be - * retrieved. + * @param {string} communicationLinkName The name of the server communication + * link. + * + * @param {object} parameters The required parameters for creating a server + * communication link. + * + * @param {string} parameters.partnerServer The name of the partner server. * * @param {object} [options] Optional Parameters. * @@ -5550,7 +7994,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServerCommunicationLink} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5558,20 +8002,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. + * See {@link ServerCommunicationLink} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServiceObjectives + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServiceObjectives { /** - * Returns a list of elastic pools in a server. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5579,6 +8033,9 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5586,14 +8043,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of elastic pools in a server. + * Gets a database service objective. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5601,6 +8058,9 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} serviceObjectiveName The name of the service objective to + * retrieve. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5613,7 +8073,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolListResult} - The deserialized result object. + * @resolve {ServiceObjective} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5621,20 +8081,20 @@ 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. + * {ServiceObjective} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjective} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5642,31 +8102,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5674,14 +8109,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new elastic pool or updates an existing elastic pool. + * Returns database service objectives. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5689,31 +8124,6 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be operated - * on (updated or created). - * - * @param {object} parameters The required parameters for creating or updating - * an elastic pool. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -5726,7 +8136,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ServiceObjectiveListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5734,20 +8144,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceObjectiveListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolActivities { /** - * Updates an existing elastic pool. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5755,27 +8175,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5784,14 +8185,14 @@ export interface ElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, parameters: models.ElasticPoolUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing elastic pool. + * Returns elastic pool activities. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5799,27 +8200,8 @@ export interface ElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool to be updated. - * - * @param {object} parameters The required parameters for updating an elastic - * pool. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {string} [parameters.edition] The edition of the elastic pool. - * Possible values include: 'Basic', 'Standard', 'Premium' - * - * @param {number} [parameters.dtu] The total shared DTU for the database - * elastic pool. - * - * @param {number} [parameters.databaseDtuMax] The maximum DTU any one database - * can consume. - * - * @param {number} [parameters.databaseDtuMin] The minimum DTU all databases - * are guaranteed. - * - * @param {number} [parameters.storageMB] Gets storage limit for the database - * elastic pool in MB. + * @param {string} elasticPoolName The name of the elastic pool for which to + * get the current activity. * * @param {object} [options] Optional Parameters. * @@ -5833,7 +8215,7 @@ export interface ElasticPools { * * {Promise} A promise is returned. * - * @resolve {ElasticPool} - The deserialized result object. + * @resolve {ElasticPoolActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5841,29 +8223,30 @@ export interface ElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPool} for more information. + * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolActivityListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ReplicationLinks + * ElasticPoolDatabaseActivities * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ReplicationLinks { +export interface ElasticPoolDatabaseActivities { /** - * Deletes a database replication link. Cannot be done during failover. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5871,10 +8254,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be dropped. - * - * @param {string} linkId The ID of the replication link to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5883,14 +8263,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a database replication link. Cannot be done during failover. + * Returns activity on databases inside of an elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5898,10 +8278,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be dropped. - * - * @param {string} linkId The ID of the replication link to be deleted. + * @param {string} elasticPoolName The name of the elastic pool. * * @param {object} [options] Optional Parameters. * @@ -5915,7 +8292,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5923,19 +8300,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolDatabaseActivityListResult} for + * more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServiceTierAdvisors + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServiceTierAdvisors { /** - * Gets a database replication link. + * Gets a service tier advisor. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5943,9 +8331,9 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get the link for. + * @param {string} databaseName The name of database. * - * @param {string} linkId The replication link ID to be retrieved. + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5954,14 +8342,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database replication link. + * Gets a service tier advisor. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -5969,9 +8357,9 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get the link for. + * @param {string} databaseName The name of database. * - * @param {string} linkId The replication link ID to be retrieved. + * @param {string} serviceTierAdvisorName The name of service tier advisor. * * @param {object} [options] Optional Parameters. * @@ -5985,7 +8373,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLink} - The deserialized result object. + * @resolve {ServiceTierAdvisor} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5993,21 +8381,20 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ReplicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ReplicationLink} for more information. + * {ServiceTierAdvisor} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTierAdvisor} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns service tier advisors for specified database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6015,10 +8402,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -6027,15 +8411,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns service tier advisors for specified database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6043,10 +8426,7 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of database. * * @param {object} [options] Optional Parameters. * @@ -6060,7 +8440,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6068,20 +8448,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServiceTierAdvisorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceTierAdvisorListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - failover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TransparentDataEncryptions + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface TransparentDataEncryptions { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Creates or updates a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6089,10 +8479,14 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {object} parameters The required parameters for creating or updating + * transparent data encryption. + * + * @param {string} [parameters.status] The status of the database transparent + * data encryption. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -6101,15 +8495,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Creates or updates a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6117,10 +8510,14 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. + * @param {string} databaseName The name of the database for which setting the + * transparent data encryption applies. * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {object} parameters The required parameters for creating or updating + * transparent data encryption. + * + * @param {string} [parameters.status] The status of the database transparent + * data encryption. Possible values include: 'Enabled', 'Disabled' * * @param {object} [options] Optional Parameters. * @@ -6134,7 +8531,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6142,19 +8539,21 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryption} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - failoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists a database's replication links. + * Gets a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6162,7 +8561,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to retrieve links for. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6171,14 +8571,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists a database's replication links. + * Gets a database's transparent data encryption configuration. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6186,7 +8586,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to retrieve links for. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6200,7 +8601,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {ReplicationLinkListResult} - The deserialized result object. + * @resolve {TransparentDataEncryption} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6208,22 +8609,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ReplicationLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ReplicationLinkListResult} for more + * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryption} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TransparentDataEncryptionActivities + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface TransparentDataEncryptionActivities { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns a database's transparent data encryption operation result. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6231,10 +8640,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6243,15 +8650,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByConfigurationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. + * Returns a database's transparent data encryption operation result. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6259,10 +8665,8 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. + * @param {string} databaseName The name of the database for which the + * transparent data encryption applies. * * @param {object} [options] Optional Parameters. * @@ -6276,7 +8680,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6284,20 +8688,30 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {TransparentDataEncryptionActivityListResult} [result] - The deserialized result object if an error did not occur. + * See {@link TransparentDataEncryptionActivityListResult} + * for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - beginFailover(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerUsages + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerUsages { /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Returns server usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6305,11 +8719,6 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6317,15 +8726,14 @@ export interface ReplicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets which replica database is primary by failing over from the current - * primary replica database. This operation might result in data loss. + * Returns server usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6333,11 +8741,6 @@ export interface ReplicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database that has the - * replication link to be failed over. - * - * @param {string} linkId The ID of the replication link to be failed over. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6350,7 +8753,7 @@ export interface ReplicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6358,29 +8761,29 @@ export interface ReplicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerUsageListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, callback: ServiceCallback): void; - beginFailoverAllowDataLoss(resourceGroupName: string, serverName: string, databaseName: string, linkId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 - * ServerAzureADAdministrators + * DatabaseUsages * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ServerAzureADAdministrators { +export interface DatabaseUsages { /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Returns database usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6388,15 +8791,7 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6405,15 +8800,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Returns database usages. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6421,15 +8815,7 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. - * - * @param {string} properties.login The server administrator login value. - * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). - * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -6443,7 +8829,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6451,21 +8837,30 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseUsageListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseBlobAuditingPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseBlobAuditingPolicies { /** - * Deletes an existing server Active Directory Administrator. + * Gets a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6473,6 +8868,9 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6480,14 +8878,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * Gets a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6495,6 +8893,9 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * audit policy is defined. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6507,7 +8908,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6515,21 +8916,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 an server Administrator. + * Creates or updates a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6537,6 +8938,35 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6544,14 +8974,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an server Administrator. + * Creates or updates a database's blob auditing policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6559,6 +8989,35 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database for which the blob + * auditing policy will be defined. + * + * @param {object} parameters The database blob auditing policy. + * + * @param {string} parameters.state Specifies the state of the policy. If state + * is Enabled, storageEndpoint and storageAccountAccessKey are required. + * Possible values include: 'Enabled', 'Disabled' + * + * @param {string} [parameters.storageEndpoint] Specifies the blob storage + * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is + * Enabled, storageEndpoint is required. + * + * @param {string} [parameters.storageAccountAccessKey] Specifies the + * identifier key of the auditing storage account. If state is Enabled, + * storageAccountAccessKey is required. + * + * @param {number} [parameters.retentionDays] Specifies the number of days to + * keep in the audit logs. + * + * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and + * Actions-Groups to audit. + * + * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob + * storage subscription Id. + * + * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether + * storageAccountAccessKey value is the storage’s secondary key. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6571,7 +9030,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6579,21 +9038,30 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseBlobAuditingPolicy} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseAutomaticTuningOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseAutomaticTuningOperations { /** - * Returns a list of server Administrators. + * Gets a database's automatic tuning. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6601,6 +9069,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6608,14 +9078,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a list of server Administrators. + * Gets a database's automatic tuning. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6623,6 +9093,8 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6635,7 +9107,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAdministratorListResult} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6643,22 +9115,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAdministratorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAdministratorListResult} for more + * {DatabaseAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Update automatic tuning properties for target database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6666,15 +9137,14 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. + * @param {string} databaseName The name of the database. * - * @param {string} properties.login The server administrator login value. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -6683,15 +9153,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a new Server Active Directory Administrator or updates an existing - * server Active Directory Administrator. + * Update automatic tuning properties for target database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6699,15 +9168,14 @@ export interface ServerAzureADAdministrators { * * @param {string} serverName The name of the server. * - * @param {object} properties The required parameters for creating or updating - * an Active Directory Administrator. + * @param {string} databaseName The name of the database. * - * @param {string} properties.login The server administrator login value. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {uuid} properties.sid The server administrator Sid (Secure ID). + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Inherit', 'Custom', 'Auto', 'Unspecified' * - * @param {uuid} properties.tenantId The server Active Directory Administrator - * tenant id. + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -6721,7 +9189,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {DatabaseAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6729,21 +9197,30 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {DatabaseAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseAutomaticTuning} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, properties: models.ServerAzureADAdministrator, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseAutomaticTuning, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * EncryptionProtectors + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface EncryptionProtectors { /** - * Deletes an existing server Active Directory Administrator. + * Gets a list of server encryption protectors * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6758,14 +9235,14 @@ export interface ServerAzureADAdministrators { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an existing server Active Directory Administrator. + * Gets a list of server encryption protectors * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6785,7 +9262,7 @@ export interface ServerAzureADAdministrators { * * {Promise} A promise is returned. * - * @resolve {ServerAzureADAdministrator} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6793,30 +9270,21 @@ export interface ServerAzureADAdministrators { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAzureADAdministrator} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAzureADAdministrator} for more + * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtectorListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerCommunicationLinks - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerCommunicationLinks { + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server communication link. + * Gets a server encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6824,9 +9292,6 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6834,14 +9299,14 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server communication link. + * Gets a server encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6849,9 +9314,6 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -6864,7 +9326,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6872,19 +9334,20 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6892,8 +9355,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6902,14 +9374,14 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6917,8 +9389,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6932,7 +9413,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6940,21 +9421,20 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, communicationLinkName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, communicationLinkName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, communicationLinkName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6962,13 +9442,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -6977,14 +9461,14 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. + * Updates an existing encryption protector. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -6992,13 +9476,17 @@ export interface ServerCommunicationLinks { * * @param {string} serverName The name of the server. * - * @param {string} communicationLinkName The name of the server communication - * link. + * @param {object} parameters The requested encryption protector resource + * state. * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} [parameters.serverKeyName] The name of the server key. + * + * @param {string} parameters.serverKeyType The encryption protector type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * * @param {object} [options] Optional Parameters. * @@ -7012,7 +9500,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {EncryptionProtector} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7020,27 +9508,23 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. + * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtector} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server communication links. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a list of server encryption protectors * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7049,20 +9533,17 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server communication links. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a list of server encryption protectors * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7076,7 +9557,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLinkListResult} - The deserialized result object. + * @resolve {EncryptionProtectorListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7084,35 +9565,39 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLinkListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLinkListResult} for more + * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. + * See {@link EncryptionProtectorListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * FailoverGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface FailoverGroups { /** - * Creates a server communication link. + * Gets a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7121,28 +9606,23 @@ export interface ServerCommunicationLinks { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server communication link. + * Gets a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} communicationLinkName The name of the server communication - * link. - * - * @param {object} parameters The required parameters for creating a server - * communication link. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.partnerServer The name of the partner server. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7156,7 +9636,7 @@ export interface ServerCommunicationLinks { * * {Promise} A promise is returned. * - * @resolve {ServerCommunicationLink} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7164,39 +9644,60 @@ export interface ServerCommunicationLinks { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerCommunicationLink} [result] - The deserialized result object if an error did not occur. - * See {@link ServerCommunicationLink} for more - * information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, communicationLinkName: string, parameters: models.ServerCommunicationLink, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceObjectives - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServiceObjectives { + get(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database service objective. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7205,23 +9706,54 @@ export interface ServiceObjectives { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database service objective. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} serviceObjectiveName The name of the service objective to - * retrieve. + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7235,7 +9767,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjective} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7243,26 +9775,29 @@ export interface ServiceObjectives { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceObjective} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjective} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, serviceObjectiveName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database service objectives. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7271,20 +9806,23 @@ export interface ServiceObjectives { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database service objectives. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7298,7 +9836,7 @@ export interface ServiceObjectives { * * {Promise} A promise is returned. * - * @resolve {ServiceObjectiveListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7306,35 +9844,56 @@ export interface ServiceObjectives { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceObjectiveListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceObjectiveListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Servers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Servers { + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Determines whether a resource can be created with the specified name. + * Updates a failover group. * - * @param {object} parameters The parameters to request for name availability. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} parameters.name The name whose availability is to be - * checked. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7343,19 +9902,51 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - checkNameAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Determines whether a resource can be created with the specified name. + * Updates a failover group. * - * @param {object} parameters The parameters to request for name availability. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} parameters.name The name whose availability is to be - * checked. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -7369,7 +9960,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {CheckNameAvailabilityResponse} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7377,21 +9968,27 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. - * See {@link CheckNameAvailabilityResponse} for more - * information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, callback: ServiceCallback): void; - checkNameAvailability(parameters: models.CheckNameAvailabilityRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of all servers in the subscription. + * Lists the failover groups in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7400,14 +9997,21 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all servers in the subscription. + * Lists the failover groups in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server containing the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7421,7 +10025,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7429,25 +10033,31 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of servers in a resource groups. + * Fails over from the current primary server to this server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7455,19 +10065,24 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of servers in a resource groups. + * Fails over from the current primary server to this server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7480,7 +10095,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7488,26 +10103,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7516,20 +10135,24 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7543,7 +10166,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7551,48 +10174,60 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} parameters The requested server resource state. + * @param {string} failoverGroupName The name of the failover group. * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. + * @param {object} parameters The failover group parameters. * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' * - * @param {string} [parameters.version] The version of the server. + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' * - * @param {object} [parameters.tags] Resource tags. + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. * - * @param {string} parameters.location Resource location. + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7601,42 +10236,54 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} parameters The requested server resource state. + * @param {string} failoverGroupName The name of the failover group. * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. + * @param {object} parameters The failover group parameters. * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' * - * @param {string} [parameters.version] The version of the server. + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerServers List of partner server information + * for the failover group. + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [options] Optional Parameters. * @@ -7650,7 +10297,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7658,26 +10305,29 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7690,16 +10340,19 @@ export interface Servers { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7727,29 +10380,48 @@ export interface Servers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a server. + * Updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} parameters The requested server resource state. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters The failover group parameters. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. * - * @param {string} [parameters.version] The version of the server. + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [parameters.tags] Resource tags. * @@ -7760,30 +10432,49 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server. + * Updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {object} parameters The requested server resource state. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. + * @param {object} parameters The failover group parameters. * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). + * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the + * failover group instance. * - * @param {string} [parameters.version] The version of the server. + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} [parameters.databases] List of databases in the failover + * group. * * @param {object} [parameters.tags] Resource tags. * @@ -7799,7 +10490,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7807,48 +10498,29 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server. + * Fails over from the current primary server to this server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7857,42 +10529,23 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server. + * Fails over from the current primary server to this server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {object} [parameters.identity] The Azure Active Directory identity of - * the server. - * - * @param {string} [parameters.identity.type] The identity type. Set this to - * 'SystemAssigned' in order to automatically create and assign an Azure Active - * Directory principal for the resource. Possible values include: - * 'SystemAssigned' - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. - * - * @param {object} [parameters.tags] Resource tags. + * @param {string} serverName The name of the server containing the failover + * group. * - * @param {string} parameters.location Resource location. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7906,7 +10559,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7914,26 +10567,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.Server, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7942,20 +10599,24 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a server. + * Fails over from the current primary server to this server. This operation + * might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server containing the failover + * group. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -7969,7 +10630,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {FailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7977,37 +10638,23 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {FailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a server. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. + * Lists the failover groups in a server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8016,32 +10663,17 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a server. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested server resource state. - * - * @param {string} [parameters.administratorLogin] Administrator username for - * the server. Once created it cannot be changed. - * - * @param {string} [parameters.administratorLoginPassword] The administrator - * login password (required for server creation). - * - * @param {string} [parameters.version] The version of the server. + * Lists the failover groups in a server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8055,7 +10687,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {Server} - The deserialized result object. + * @resolve {FailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8063,23 +10695,30 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Server} [result] - The deserialized result object if an error did not occur. - * See {@link Server} for more information. + * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link FailoverGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, parameters: models.ServerUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Operations { /** - * Gets a list of all servers in the subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -8088,17 +10727,14 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of all servers in the subscription. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -8112,7 +10748,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8120,20 +10756,20 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of servers in a resource groups. + * Lists all of the available SQL Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8145,14 +10781,14 @@ export interface Servers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of servers in a resource groups. + * Lists all of the available SQL Rest API operations. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -8169,7 +10805,7 @@ export interface Servers { * * {Promise} A promise is returned. * - * @resolve {ServerListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8177,29 +10813,29 @@ export interface Servers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerListResult} for more information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * ElasticPoolActivities + * ServerKeys * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ElasticPoolActivities { +export interface ServerKeys { /** - * Returns elastic pool activities. + * Gets a list of server keys. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8207,9 +10843,6 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8217,14 +10850,14 @@ export interface ElasticPoolActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns elastic pool activities. + * Gets a list of server keys. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8232,9 +10865,6 @@ export interface ElasticPoolActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool for which to - * get the current activity. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8247,7 +10877,7 @@ export interface ElasticPoolActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolActivityListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8255,30 +10885,20 @@ export interface ElasticPoolActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolActivityListResult} for more - * information. + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPoolDatabaseActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolDatabaseActivities { + 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 activity on databases inside of an elastic pool. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8286,7 +10906,7 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -8295,14 +10915,14 @@ export interface ElasticPoolDatabaseActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns activity on databases inside of an elastic pool. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8310,7 +10930,7 @@ export interface ElasticPoolDatabaseActivities { * * @param {string} serverName The name of the server. * - * @param {string} elasticPoolName The name of the elastic pool. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -8324,7 +10944,7 @@ export interface ElasticPoolDatabaseActivities { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolDatabaseActivityListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8332,30 +10952,20 @@ export interface ElasticPoolDatabaseActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolDatabaseActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolDatabaseActivityListResult} for - * more information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; - listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * RecommendedElasticPools - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface RecommendedElasticPools { + get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a recommented elastic pool. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8363,8 +10973,27 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8373,23 +11002,42 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a recommented elastic pool. + * Creates or updates a server key. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. * - * @param {string} resourceGroupName The name 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.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * @param {string} serverName The name of the server. + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8403,7 +11051,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPool} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8411,21 +11059,20 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPool} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPool} for more - * information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns recommended elastic pools. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8433,6 +11080,8 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be deleted. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8440,14 +11089,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommended elastic pools. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8455,6 +11104,8 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * + * @param {string} keyName The name of the server key to be deleted. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8467,7 +11118,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8475,21 +11126,19 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns recommented elastic pool metrics. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8497,8 +11146,27 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8507,14 +11175,14 @@ export interface RecommendedElasticPools { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns recommented elastic pool metrics. + * Creates or updates a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8522,8 +11190,27 @@ export interface RecommendedElasticPools { * * @param {string} serverName The name of the server. * - * @param {string} recommendedElasticPoolName The name of the recommended - * elastic pool to be retrieved. + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -8537,7 +11224,7 @@ export interface RecommendedElasticPools { * * {Promise} A promise is returned. * - * @resolve {RecommendedElasticPoolListMetricsResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8545,30 +11232,20 @@ export interface RecommendedElasticPools { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RecommendedElasticPoolListMetricsResult} [result] - The deserialized result object if an error did not occur. - * See {@link RecommendedElasticPoolListMetricsResult} for - * more information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, serverName: string, recommendedElasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServiceTierAdvisors - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServiceTierAdvisors { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a service tier advisor. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8576,9 +11253,7 @@ export interface ServiceTierAdvisors { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of database. - * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8587,14 +11262,14 @@ export interface ServiceTierAdvisors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a service tier advisor. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -8602,9 +11277,7 @@ export interface ServiceTierAdvisors { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of database. - * - * @param {string} serviceTierAdvisorName The name of service tier advisor. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -8618,7 +11291,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisor} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8626,28 +11299,22 @@ export interface ServiceTierAdvisors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceTierAdvisor} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceTierAdvisor} for more information. + * {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, serviceTierAdvisorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, serviceTierAdvisorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns service tier advisors for specified database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a list of server keys. * - * @param {string} databaseName The name of database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8656,22 +11323,17 @@ export interface ServiceTierAdvisors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns service tier advisors for specified database. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a list of server keys. * - * @param {string} databaseName The name of database. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -8685,7 +11347,7 @@ export interface ServiceTierAdvisors { * * {Promise} A promise is returned. * - * @resolve {ServiceTierAdvisorListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8693,45 +11355,38 @@ export interface ServiceTierAdvisors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceTierAdvisorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceTierAdvisorListResult} for more - * information. + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * TransparentDataEncryptions + * SyncAgents * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface TransparentDataEncryptions { +export interface SyncAgents { /** - * Creates or updates a database's transparent data encryption configuration. + * Gets a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which setting the - * transparent data encryption applies. - * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8740,29 +11395,23 @@ export interface TransparentDataEncryptions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's transparent data encryption configuration. + * Gets a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which setting the - * transparent data encryption applies. - * - * @param {object} parameters The required parameters for creating or updating - * transparent data encryption. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.status] The status of the database transparent - * data encryption. Possible values include: 'Enabled', 'Disabled' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8776,7 +11425,7 @@ export interface TransparentDataEncryptions { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryption} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8784,30 +11433,34 @@ export interface TransparentDataEncryptions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryption} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.TransparentDataEncryption, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's transparent data encryption configuration. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. + * + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8816,23 +11469,28 @@ export interface TransparentDataEncryptions { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's transparent data encryption configuration. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. + * + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8846,7 +11504,7 @@ export interface TransparentDataEncryptions { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryption} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8854,39 +11512,29 @@ export interface TransparentDataEncryptions { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryption} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryption} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * TransparentDataEncryptionActivities - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface TransparentDataEncryptionActivities { + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a database's transparent data encryption operation result. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8895,23 +11543,23 @@ export interface TransparentDataEncryptionActivities { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByConfigurationWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a database's transparent data encryption operation result. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the - * transparent data encryption applies. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -8925,7 +11573,7 @@ export interface TransparentDataEncryptionActivities { * * {Promise} A promise is returned. * - * @resolve {TransparentDataEncryptionActivityListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -8933,36 +11581,26 @@ export interface TransparentDataEncryptionActivities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {TransparentDataEncryptionActivityListResult} [result] - The deserialized result object if an error did not occur. - * See {@link TransparentDataEncryptionActivityListResult} - * for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByConfiguration(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerUsages { + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns server usages. + * Lists sync agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8971,20 +11609,21 @@ export interface ServerUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns server usages. + * Lists sync agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -8998,7 +11637,7 @@ export interface ServerUsages { * * {Promise} A promise is returned. * - * @resolve {ServerUsageListResult} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9006,37 +11645,29 @@ export interface ServerUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerUsageListResult} for more information. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseUsages { + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns database usages. + * Generates a sync agent key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9045,22 +11676,23 @@ export interface DatabaseUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns database usages. + * Generates a sync agent key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9074,7 +11706,7 @@ export interface DatabaseUsages { * * {Promise} A promise is returned. * - * @resolve {DatabaseUsageListResult} - The deserialized result object. + * @resolve {SyncAgentKeyProperties} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9082,39 +11714,30 @@ export interface DatabaseUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseUsageListResult} for more + * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentKeyProperties} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * DatabaseBlobAuditingPolicies - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface DatabaseBlobAuditingPolicies { + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a database's blob auditing policy. + * Lists databases linked to a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9123,23 +11746,23 @@ export interface DatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's blob auditing policy. + * Lists databases linked to a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database for which the blob - * audit policy is defined. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9153,7 +11776,7 @@ export interface DatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9161,56 +11784,35 @@ export interface DatabaseBlobAuditingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} for more + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, 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; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a database's blob auditing policy. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the blob - * auditing policy will be defined. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. + * @param {string} syncAgentName The name of the sync agent. * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {object} parameters The requested sync agent resource state. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9219,49 +11821,28 @@ export interface DatabaseBlobAuditingPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a database's blob auditing policy. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database for which the blob - * auditing policy will be defined. - * - * @param {object} parameters The database blob auditing policy. - * - * @param {string} parameters.state Specifies the state of the policy. If state - * is Enabled, storageEndpoint and storageAccountAccessKey are required. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {string} [parameters.storageEndpoint] Specifies the blob storage - * endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is - * Enabled, storageEndpoint is required. - * - * @param {string} [parameters.storageAccountAccessKey] Specifies the - * identifier key of the auditing storage account. If state is Enabled, - * storageAccountAccessKey is required. - * - * @param {number} [parameters.retentionDays] Specifies the number of days to - * keep in the audit logs. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {array} [parameters.auditActionsAndGroups] Specifies the Actions and - * Actions-Groups to audit. + * @param {string} syncAgentName The name of the sync agent. * - * @param {uuid} [parameters.storageAccountSubscriptionId] Specifies the blob - * storage subscription Id. + * @param {object} parameters The requested sync agent resource state. * - * @param {boolean} [parameters.isStorageSecondaryKeyInUse] Specifies whether - * storageAccountAccessKey value is the storage’s secondary key. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9275,7 +11856,7 @@ export interface DatabaseBlobAuditingPolicies { * * {Promise} A promise is returned. * - * @resolve {DatabaseBlobAuditingPolicy} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9283,36 +11864,29 @@ export interface DatabaseBlobAuditingPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseBlobAuditingPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseBlobAuditingPolicy} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.DatabaseBlobAuditingPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * EncryptionProtectors - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface EncryptionProtectors { + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server encryption protectors + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. + * + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9321,20 +11895,23 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server encryption protectors + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. + * + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -9348,7 +11925,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtectorListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9356,27 +11933,22 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtectorListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Lists sync agents in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9385,20 +11957,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Lists sync agents in a server. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9412,7 +11981,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9420,38 +11989,23 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Lists databases linked to a sync agent. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9460,32 +12014,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Lists databases linked to a sync agent. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -9499,7 +12038,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9507,38 +12046,33 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; + listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncGroups { /** - * Updates an existing encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Gets a collection of sync database ids. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9547,32 +12081,17 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing encryption protector. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {object} parameters The requested encryption protector resource - * state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} [parameters.serverKeyName] The name of the server key. + * Gets a collection of sync database ids. * - * @param {string} parameters.serverKeyType The encryption protector type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -9586,7 +12105,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtector} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9594,23 +12113,32 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtector} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtector} for more information. + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, parameters: models.EncryptionProtector, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; + listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server encryption protectors + * Refreshes a hub database schema. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9619,17 +12147,25 @@ export interface EncryptionProtectors { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server encryption protectors + * Refreshes a hub database schema. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9643,7 +12179,7 @@ export interface EncryptionProtectors { * * {Promise} A promise is returned. * - * @resolve {EncryptionProtectorListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9651,39 +12187,30 @@ export interface EncryptionProtectors { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {EncryptionProtectorListResult} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionProtectorListResult} for more - * information. - * + * {null} [result] - The deserialized result object if an error did not occur. + * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FailoverGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface FailoverGroups { + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a failover group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9692,23 +12219,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a failover group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9722,7 +12251,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9730,119 +12259,82 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a failover group. + * Gets a collection of sync group logs. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {string} serverName The name of the server. * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} startTime Get logs generated after this time. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} endTime Get logs generated before this time. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * Gets a collection of sync group logs. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.tags] Resource tags. - * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {string} serverName The name of the server. * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} startTime Get logs generated after this time. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} endTime Get logs generated before this time. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9853,7 +12345,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -9861,29 +12353,32 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a failover group. + * Cancels a sync group synchronization. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9896,19 +12391,21 @@ export interface FailoverGroups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a failover group. + * Cancels a sync group synchronization. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9936,50 +12433,24 @@ export interface FailoverGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a failover group. + * Triggers a sync group synchronization. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -9988,51 +12459,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a failover group. + * Triggers a sync group synchronization. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * Manager API or the portal. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} serverName The name of the server. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10046,7 +12491,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10054,27 +12499,30 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the failover groups in a server. + * Gets a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10083,21 +12531,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * Gets a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10111,7 +12563,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10119,30 +12571,55 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroupListResult} for more - * information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10151,23 +12628,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - failoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10181,7 +12684,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10189,30 +12692,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - failover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10221,24 +12725,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10252,7 +12757,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10260,60 +12765,54 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - forceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a failover group. + * Updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The failover group parameters. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} [parameters.tags] Resource tags. + * @param {object} parameters The requested sync group resource state. * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10322,54 +12821,49 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a failover group. + * Updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} serverName The name of the server. * - * @param {object} parameters The failover group parameters. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters.readWriteEndpoint Read-write endpoint of the - * failover group instance. + * @param {object} parameters The requested sync group resource state. * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {array} parameters.partnerServers List of partner server information - * for the failover group. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10383,7 +12877,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10391,29 +12885,29 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a failover group. + * Lists sync groups under a hub database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -10422,23 +12916,23 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a failover group. + * Lists sync groups under a hub database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * * @param {object} [options] Optional Parameters. * @@ -10452,7 +12946,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10460,56 +12954,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a failover group. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10518,51 +12987,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a failover group. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. - * - * @param {string} failoverGroupName The name of the failover group. - * - * @param {object} parameters The failover group parameters. - * - * @param {object} [parameters.readWriteEndpoint] Read-write endpoint of the - * failover group instance. - * - * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy - * of the read-write endpoint for the failover group. If failoverPolicy is - * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible - * values include: 'Manual', 'Automatic' - * - * @param {number} - * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace - * period before failover with data loss is attempted for the read-write - * endpoint. If failoverPolicy is Automatic then - * failoverWithDataLossGracePeriodMinutes is required. - * - * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the - * failover group instance. - * - * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy - * of the read-only endpoint for the failover group. Possible values include: - * 'Disabled', 'Enabled' + * @param {string} serverName The name of the server. * - * @param {array} [parameters.databases] List of databases in the failover - * group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10576,7 +13019,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10584,125 +13027,105 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, failoverGroupName: string, parameters: models.FailoverGroupUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Fails over from the current primary server to this server. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [options] Optional Parameters. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters The requested sync group resource state. * - * @returns {Promise} A promise is returned + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @reject {Error|ServiceError} - The error object. - */ - beginFailoverWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Fails over from the current primary server to this server. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} failoverGroupName The name of the failover group. + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FailoverGroup} - 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. - * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginFailover(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {string} serverName The name of the server. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [options] Optional Parameters. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} parameters The requested sync group resource state. * - * @returns {Promise} A promise is returned + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @reject {Error|ServiceError} - The error object. - */ - beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Fails over from the current primary server to this server. This operation - * might result in data loss. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} serverName The name of the server containing the failover - * group. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} failoverGroupName The name of the failover group. + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10716,7 +13139,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroup} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10724,23 +13147,31 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroup} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroup} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, callback: ServiceCallback): void; - beginForceFailoverAllowDataLoss(resourceGroupName: string, serverName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the failover groups in a server. + * Deletes a sync group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10749,17 +13180,25 @@ export interface FailoverGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the failover groups in a server. + * Deletes a sync group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -10773,7 +13212,7 @@ export interface FailoverGroups { * * {Promise} A promise is returned. * - * @resolve {FailoverGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10781,30 +13220,54 @@ export interface FailoverGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {FailoverGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link FailoverGroupListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Operations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface Operations { + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Updates a sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10813,14 +13276,49 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Updates a sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -10834,7 +13332,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10842,20 +13340,20 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of sync database ids. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10867,14 +13365,14 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a collection of sync database ids. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10891,7 +13389,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10899,35 +13397,24 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerKeys - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerKeys { + listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; + listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server keys. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a collection of hub database schemas. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10936,20 +13423,17 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a collection of hub database schemas. * - * @param {string} serverName The name of the server. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -10963,7 +13447,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10971,28 +13455,24 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a collection of sync group logs. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11001,22 +13481,17 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a server key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} serverName The name of the server. + * @reject {Error|ServiceError} - The error object. + */ + listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync group logs. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11030,7 +13505,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11038,48 +13513,24 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLogsNext(nextPageLink: string, callback: ServiceCallback): void; + listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 - * - * @param {object} parameters The requested server key resource state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' - * - * @param {string} [parameters.uri] The URI of the server key. - * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * Lists sync groups under a hub database. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11088,42 +13539,17 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 - * - * @param {object} parameters The requested server key resource state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' - * - * @param {string} [parameters.uri] The URI of the server key. - * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * Lists sync groups under a hub database. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11137,7 +13563,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11145,20 +13571,29 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncMembers + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncMembers { /** - * Deletes the server key with the given name. + * Gets a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11166,7 +13601,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11175,14 +13616,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Gets a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11190,7 +13631,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11204,7 +13651,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11212,19 +13659,20 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11232,27 +13680,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11261,14 +13722,14 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11276,27 +13737,40 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested server key resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} syncMemberName The name of the sync member. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {object} parameters The requested sync member resource state. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11310,7 +13784,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11318,20 +13792,20 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11339,7 +13813,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11352,10 +13832,10 @@ export interface ServerKeys { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -11363,7 +13843,13 @@ export interface ServerKeys { * * @param {string} serverName The name of the server. * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11391,113 +13877,111 @@ export interface ServerKeys { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server keys. + * Updates an existing sync member. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @returns {Promise} A promise is returned + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} syncMemberName The name of the sync member. * - * @reject {Error|ServiceError} - The error object. - */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of server keys. + * @param {object} parameters The requested sync member resource state. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. * - * {Promise} A promise is returned. + * @param {string} [parameters.userName] User name of the member database in + * the sync member. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @param {string} [parameters.password] Password of the member database in the + * sync member. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {object} [options] Optional Parameters. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncAgents - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncAgents { - + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync agent. + * Updates an existing sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} [options] Optional Parameters. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} syncMemberName The name of the sync member. * - * @returns {Promise} A promise is returned + * @param {object} parameters The requested sync member resource state. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a sync agent. + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11511,7 +13995,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11519,34 +14003,31 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. + * Lists sync members in the given sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} serverName The name of the server. * - * @param {object} parameters The requested sync agent resource state. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -11555,28 +14036,25 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Lists sync members in the given sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} serverName The name of the server. * - * @param {object} parameters The requested sync agent resource state. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -11590,7 +14068,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11598,29 +14076,34 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync agent. + * Gets a sync member database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11629,23 +14112,28 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Gets a sync member database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11659,7 +14147,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11667,26 +14155,35 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. + * Refreshes a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11695,21 +14192,28 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Refreshes a sync member database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11723,7 +14227,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11731,29 +14235,60 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Generates a sync agent key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11762,23 +14297,55 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates a sync agent key. + * Creates or updates a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11792,7 +14359,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentKeyProperties} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11800,30 +14367,34 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentKeyProperties} for more - * information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11832,23 +14403,28 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Deletes a sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11862,7 +14438,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11870,35 +14446,60 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. + * Updates an existing sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested sync agent resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11907,28 +14508,55 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Updates an existing sync member. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {object} parameters The requested sync agent resource state. + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' * * @param {object} [options] Optional Parameters. * @@ -11942,7 +14570,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {SyncMember} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11950,29 +14578,34 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync agent. + * Refreshes a sync member database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -11985,19 +14618,24 @@ export interface SyncAgents { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Refreshes a sync member database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. * * @param {object} [options] Optional Parameters. * @@ -12025,13 +14663,13 @@ export interface SyncAgents { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. + * Lists sync members in the given sync group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12043,14 +14681,14 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Lists sync members in the given sync group. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12067,7 +14705,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {SyncMemberListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12075,20 +14713,20 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listBySyncGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listBySyncGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. + * Gets a sync member database schema. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12100,14 +14738,14 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Gets a sync member database schema. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -12124,7 +14762,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12132,30 +14770,30 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; - listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * SyncGroups + * SubscriptionUsages * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface SyncGroups { +export interface SubscriptionUsages { /** - * Gets a collection of sync database ids. + * Gets all subscription usage metrics in a given location. * * @param {string} locationName The name of the region where the resource is * located. @@ -12167,14 +14805,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Gets all subscription usage metrics in a given location. * * @param {string} locationName The name of the region where the resource is * located. @@ -12191,7 +14829,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12199,32 +14837,26 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; - listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a subscription usage metric. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -12233,25 +14865,19 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets a subscription usage metric. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} usageName Name of usage metric to return. * * @param {object} [options] Optional Parameters. * @@ -12265,7 +14891,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SubscriptionUsage} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12273,30 +14899,23 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SubscriptionUsage} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, usageName: string, callback: ServiceCallback): void; + get(locationName: string, usageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets all subscription usage metrics in a given location. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12305,25 +14924,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets all subscription usage metrics in a given location. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12337,7 +14948,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {SubscriptionUsageListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12345,21 +14956,30 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface VirtualNetworkRules { /** - * Gets a collection of sync group logs. + * Gets a virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12367,36 +14987,23 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. - * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Gets a virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12404,23 +15011,10 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. - * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12431,7 +15025,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12439,21 +15033,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more - * information. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels a sync group synchronization. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12461,10 +15054,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12473,14 +15072,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels a sync group synchronization. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12488,10 +15087,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12505,7 +15110,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12513,19 +15118,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Triggers a sync group synchronization. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12533,10 +15139,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12549,10 +15152,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Triggers a sync group synchronization. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12560,10 +15163,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12591,13 +15191,13 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync group. + * Gets a list of virtual network rules in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12605,11 +15205,6 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12617,14 +15212,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync group. + * Gets a list of virtual network rules in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12632,11 +15227,6 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12649,7 +15239,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12657,20 +15247,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync group. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12678,34 +15269,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12714,14 +15287,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. + * Creates or updates an existing virtual network rule. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12729,34 +15302,16 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {object} parameters The requested virtual Network Rule Resource + * state. * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. * * @param {object} [options] Optional Parameters. * @@ -12770,7 +15325,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {VirtualNetworkRule} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12778,20 +15333,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync group. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12799,10 +15354,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12815,10 +15367,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * Deletes the virtual network rule with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12826,10 +15378,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} virtualNetworkRuleName The name of the virtual network rule. * * @param {object} [options] Optional Parameters. * @@ -12857,48 +15406,16 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * Gets a list of virtual network rules in a server. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12907,49 +15424,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * Gets a list of virtual network rules in a server. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12963,7 +15448,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12971,29 +15456,38 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LongTermRetentionBackups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface LongTermRetentionBackups { /** - * Lists sync groups under a hub database. + * Gets a long term retention backup. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database. * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13002,23 +15496,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Gets a long term retention backup. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database. * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13032,7 +15525,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13040,31 +15533,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. + * Deletes a long term retention backup. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName * - * @param {string} syncGroupName The name of the sync group. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13077,21 +15568,18 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * Deletes a long term retention backup. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName * - * @param {string} syncGroupName The name of the sync group. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13119,101 +15607,57 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. + * Lists all long term retention backups for a database. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {string} locationName The location of the database * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} longTermRetentionServerName * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionDatabaseName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * Lists all long term retention backups for a database. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @param {string} locationName The location of the database * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} longTermRetentionServerName * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionDatabaseName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13225,7 +15669,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13233,60 +15677,57 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Lists the long term retention backups for a given location. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} [options] Optional Parameters. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Lists the long term retention backups for a given location. * - * @param {string} serverName The name of the server. + * @param {string} locationName The location of the database * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} [options] Optional Parameters. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -13298,7 +15739,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13306,105 +15747,127 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. + * Lists the long term retention backups for a given server. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {object} [options] Optional Parameters. * - * @param {string} syncGroupName The name of the sync group. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} parameters The requested sync group resource state. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the long term retention backups for a given server. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} locationName The location of the database * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @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 {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Updates a sync group. + * Deletes a long term retention backup. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} locationName The location of the database * - * @param {string} serverName The name of the server. + * @param {string} longTermRetentionServerName * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} longTermRetentionDatabaseName * - * @param {string} syncGroupName The name of the sync group. + * @param {string} backupName The backup name. * - * @param {object} parameters The requested sync group resource state. + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @returns {Promise} A promise is returned * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a long term retention backup. * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. + * @param {string} locationName The location of the database * - * @param {object} [parameters.schema] Sync schema of the sync group. + * @param {string} longTermRetentionServerName * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} longTermRetentionDatabaseName * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} backupName The backup name. * * @param {object} [options] Optional Parameters. * @@ -13418,7 +15881,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13426,20 +15889,19 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync database ids. + * Lists all long term retention backups for a database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13451,14 +15913,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Lists all long term retention backups for a database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13475,7 +15937,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13483,21 +15945,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; - listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of hub database schemas. + * Lists the long term retention backups for a given location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13509,14 +15971,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Lists the long term retention backups for a given location. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13533,7 +15995,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13541,21 +16003,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync group logs. + * Lists the long term retention backups for a given server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13567,14 +16029,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Lists the long term retention backups for a given server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -13591,7 +16053,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13599,24 +16061,38 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLogsNext(nextPageLink: string, callback: ServiceCallback): void; - listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * BackupLongTermRetentionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface BackupLongTermRetentionPolicies { /** - * Lists sync groups under a hub database. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13625,17 +16101,22 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Gets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -13649,7 +16130,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13657,29 +16138,21 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncMembers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncMembers { + get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member. + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13687,13 +16160,21 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} databaseName The name of the database. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters The long term retention policy info. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13702,14 +16183,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member. + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13717,13 +16198,21 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} databaseName The name of the database. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters The long term retention policy info. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13737,7 +16226,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13745,20 +16234,21 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync member. + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13766,56 +16256,67 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a database's long term retention policy. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @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 + * @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 {BackupLongTermRetentionPolicy} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Creates or updates a sync member. + * Sets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13823,40 +16324,59 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} databaseName The name of the database. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters The long term retention policy info. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {object} parameters The requested sync member resource state. + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Sets a database's long term retention policy. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -13870,7 +16390,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13878,20 +16398,30 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerAutomaticTuningOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerAutomaticTuningOperations { /** - * Deletes a sync member. + * Retrieves server automatic tuning options. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13899,14 +16429,6 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13914,14 +16436,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * Retrieves server automatic tuning options. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13929,14 +16451,6 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13949,7 +16463,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13957,19 +16471,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing sync member. + * Update automatic tuning options on server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13977,40 +16492,12 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -14019,14 +16506,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * Update automatic tuning options on server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14034,40 +16521,12 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} parameters The requested automatic tuning resource state. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {object} [parameters.options] Automatic tuning options definition. * * @param {object} [options] Optional Parameters. * @@ -14081,7 +16540,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14089,31 +16548,38 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerDnsAliases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerDnsAliases { /** - * Lists sync members in the given sync group. + * Gets a server DNS alias. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14122,25 +16588,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Gets a server DNS alias. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14154,7 +16618,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14162,34 +16626,29 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMemberListResult} for more information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member database schema. + * Creates a server dns alias. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14198,28 +16657,23 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Creates a server dns alias. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14233,7 +16687,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14241,35 +16695,29 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Deletes the server DNS alias with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14282,24 +16730,19 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Deletes the server DNS alias with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14327,111 +16770,43 @@ export interface SyncMembers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * Creates or updates a sync member. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. - * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * Gets a list of server DNS aliases for a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of server DNS aliases for a server. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. * * @param {object} [options] Optional Parameters. * @@ -14445,7 +16820,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14453,34 +16828,35 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync member. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14493,24 +16869,24 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14538,111 +16914,116 @@ export interface SyncMembers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; + acquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing sync member. + * Creates a server dns alias. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {object} parameters The requested sync member resource state. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates a server dns alias. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * * @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 {ServerDnsAlias} - 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. + * + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Updates an existing sync member. + * Deletes the server DNS alias with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {object} parameters The requested sync member resource state. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @returns {Promise} A promise is returned * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the server DNS alias with the given name. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -14656,7 +17037,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14664,34 +17045,33 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14704,24 +17084,24 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} dnsAliasName The name of the server dns alias. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {object} parameters * - * @param {string} syncMemberName The name of the sync member. + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -14749,13 +17129,13 @@ export interface SyncMembers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, callback: ServiceCallback): void; + beginAcquire(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync members in the given sync group. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -14767,14 +17147,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Gets a list of server DNS aliases for a server. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -14791,7 +17171,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14799,23 +17179,38 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMemberListResult} for more information. + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySyncGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySyncGroupNext(nextPageLink: string, callback: ServiceCallback): void; - listBySyncGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * RestorePoints + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface RestorePoints { /** - * Gets a sync member database schema. + * Gets a list of database restore points. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14824,17 +17219,22 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Gets a list of database restore points. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14848,7 +17248,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {RestorePointListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14856,30 +17256,21 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more + * {RestorePointListResult} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePointListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * VirtualNetworkRules - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface VirtualNetworkRules { + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a virtual network rule. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14887,7 +17278,13 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14896,22 +17293,28 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual network rule. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -14925,7 +17328,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14933,20 +17336,20 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an existing virtual network rule. + * Gets a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14954,16 +17357,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -14972,14 +17368,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Gets a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14987,16 +17383,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15010,7 +17399,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15018,20 +17407,20 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Deletes a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15039,7 +17428,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15052,10 +17443,10 @@ export interface VirtualNetworkRules { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Deletes a restore point. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15063,7 +17454,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -15091,13 +17484,13 @@ export interface VirtualNetworkRules { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15105,6 +17498,14 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15112,14 +17513,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Creates a restore point for a data warehouse. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15127,6 +17528,14 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -15139,7 +17548,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15147,21 +17556,29 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} for more - * information. + * {RestorePoint} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseOperations { /** - * Creates or updates an existing virtual network rule. + * Cancels the asynchronous operation on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15169,16 +17586,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -15187,14 +17597,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Cancels the asynchronous operation on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15202,16 +17612,9 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. - * - * @param {object} parameters The requested virtual Network Rule Resource - * state. - * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} databaseName The name of the database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -15225,7 +17628,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15233,20 +17636,19 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15254,7 +17656,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15263,14 +17665,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15278,7 +17680,7 @@ export interface VirtualNetworkRules { * * @param {string} serverName The name of the server. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15292,7 +17694,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15300,19 +17702,21 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseOperationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Gets a list of operations performed on the database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15324,14 +17728,14 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Gets a list of operations performed on the database. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15348,7 +17752,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15356,30 +17760,30 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRuleListResult} for more + * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * DatabaseOperations + * ElasticPoolOperations * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface DatabaseOperations { +export interface ElasticPoolOperations { /** - * Cancels the asynchronous operation on the database. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15387,7 +17791,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {uuid} operationId The operation identifier. * @@ -15402,10 +17806,10 @@ export interface DatabaseOperations { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15413,7 +17817,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {uuid} operationId The operation identifier. * @@ -15443,13 +17847,13 @@ export interface DatabaseOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, callback: ServiceCallback): void; + cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15457,7 +17861,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15466,14 +17870,14 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -15481,7 +17885,7 @@ export interface DatabaseOperations { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -15495,7 +17899,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15503,21 +17907,21 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15529,14 +17933,14 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -15553,7 +17957,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15561,15 +17965,91 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPoolNext(nextPageLink: string, callback: ServiceCallback): void; + listByElasticPoolNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @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 604e407dcc..56d738959a 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -14,12 +14,9 @@ 'use strict'; -exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); -exports.BackupLongTermRetentionVaults = require('./backupLongTermRetentionVaults'); -exports.RestorePoints = require('./restorePoints'); exports.RecoverableDatabases = require('./recoverableDatabases'); exports.RestorableDroppedDatabases = require('./restorableDroppedDatabases'); -exports.Capabilities = require('./capabilities'); +exports.Servers = require('./servers'); exports.ServerConnectionPolicies = require('./serverConnectionPolicies'); exports.DatabaseThreatDetectionPolicies = require('./databaseThreatDetectionPolicies'); exports.DataMaskingPolicies = require('./dataMaskingPolicies'); @@ -28,20 +25,20 @@ exports.FirewallRules = require('./firewallRules'); exports.GeoBackupPolicies = require('./geoBackupPolicies'); exports.Databases = require('./databases'); exports.ElasticPools = require('./elasticPools'); +exports.RecommendedElasticPools = require('./recommendedElasticPools'); exports.ReplicationLinks = require('./replicationLinks'); exports.ServerAzureADAdministrators = require('./serverAzureADAdministrators'); exports.ServerCommunicationLinks = require('./serverCommunicationLinks'); exports.ServiceObjectives = require('./serviceObjectives'); -exports.Servers = require('./servers'); exports.ElasticPoolActivities = require('./elasticPoolActivities'); exports.ElasticPoolDatabaseActivities = require('./elasticPoolDatabaseActivities'); -exports.RecommendedElasticPools = require('./recommendedElasticPools'); exports.ServiceTierAdvisors = require('./serviceTierAdvisors'); exports.TransparentDataEncryptions = require('./transparentDataEncryptions'); exports.TransparentDataEncryptionActivities = require('./transparentDataEncryptionActivities'); exports.ServerUsages = require('./serverUsages'); exports.DatabaseUsages = require('./databaseUsages'); exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies'); +exports.DatabaseAutomaticTuningOperations = require('./databaseAutomaticTuningOperations'); exports.EncryptionProtectors = require('./encryptionProtectors'); exports.FailoverGroups = require('./failoverGroups'); exports.Operations = require('./operations'); @@ -49,5 +46,13 @@ exports.ServerKeys = require('./serverKeys'); exports.SyncAgents = require('./syncAgents'); exports.SyncGroups = require('./syncGroups'); exports.SyncMembers = require('./syncMembers'); +exports.SubscriptionUsages = require('./subscriptionUsages'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); +exports.LongTermRetentionBackups = require('./longTermRetentionBackups'); +exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); +exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); +exports.ServerDnsAliases = require('./serverDnsAliases'); +exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); +exports.ElasticPoolOperations = require('./elasticPoolOperations'); +exports.Capabilities = require('./capabilities'); diff --git a/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js b/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js new file mode 100644 index 0000000000..39ad67fada --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/longTermRetentionBackups.js @@ -0,0 +1,2116 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { + throw new Error('backupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocation(locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServer(locationName, longTermRetentionServerName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let onlyLatestPerDatabase = (options && options.onlyLatestPerDatabase !== undefined) ? options.onlyLatestPerDatabase : undefined; + let databaseState = (options && options.databaseState !== undefined) ? options.databaseState : undefined; + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined && typeof onlyLatestPerDatabase !== 'boolean') { + throw new Error('onlyLatestPerDatabase must be of type boolean.'); + } + if (databaseState !== null && databaseState !== undefined && typeof databaseState.valueOf() !== 'string') { + throw new Error('databaseState must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (onlyLatestPerDatabase !== null && onlyLatestPerDatabase !== undefined) { + queryParameters.push('onlyLatestPerDatabase=' + encodeURIComponent(onlyLatestPerDatabase.toString())); + } + if (databaseState !== null && databaseState !== undefined) { + queryParameters.push('databaseState=' + encodeURIComponent(databaseState)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionServerName === null || longTermRetentionServerName === undefined || typeof longTermRetentionServerName.valueOf() !== 'string') { + throw new Error('longTermRetentionServerName cannot be null or undefined and it must be of type string.'); + } + if (longTermRetentionDatabaseName === null || longTermRetentionDatabaseName === undefined || typeof longTermRetentionDatabaseName.valueOf() !== 'string') { + throw new Error('longTermRetentionDatabaseName cannot be null or undefined and it must be of type string.'); + } + if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { + throw new Error('backupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{longTermRetentionServerName}', encodeURIComponent(longTermRetentionServerName)); + requestUrl = requestUrl.replace('{longTermRetentionDatabaseName}', encodeURIComponent(longTermRetentionDatabaseName)); + requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByDatabaseNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocationNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['LongTermRetentionBackupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a LongTermRetentionBackups. */ +class LongTermRetentionBackups { + /** + * Create a LongTermRetentionBackups. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._listByDatabase = _listByDatabase; + this._listByLocation = _listByLocation; + this._listByServer = _listByServer; + this._beginDeleteMethod = _beginDeleteMethod; + this._listByDatabaseNext = _listByDatabaseNext; + this._listByLocationNext = _listByLocationNext; + this._listByServerNext = _listByServerNext; + } + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(locationName, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(locationName, longTermRetentionServerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(locationName, longTermRetentionServerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(locationName, longTermRetentionServerName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(locationName, longTermRetentionServerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(locationName, longTermRetentionServerName, options, optionalCallback); + } + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options, optionalCallback); + } + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabaseNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabaseNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabaseNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServerNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = LongTermRetentionBackups; diff --git a/lib/services/sqlManagement2/lib/operations/replicationLinks.js b/lib/services/sqlManagement2/lib/operations/replicationLinks.js index c728ae73a3..c0895596f9 100644 --- a/lib/services/sqlManagement2/lib/operations/replicationLinks.js +++ b/lib/services/sqlManagement2/lib/operations/replicationLinks.js @@ -713,7 +713,7 @@ function _beginFailover(resourceGroupName, serverName, databaseName, linkId, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -854,7 +854,7 @@ function _beginFailoverAllowDataLoss(resourceGroupName, serverName, databaseName return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 202) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/restorePoints.js b/lib/services/sqlManagement2/lib/operations/restorePoints.js index 894ccdc7cf..7c1928a3fe 100644 --- a/lib/services/sqlManagement2/lib/operations/restorePoints.js +++ b/lib/services/sqlManagement2/lib/operations/restorePoints.js @@ -23,8 +23,7 @@ const WebResource = msRest.WebResource; * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database to get available - * restore points. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -55,12 +54,9 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2014-04-01'; + let apiVersion = '2017-03-01-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } @@ -70,6 +66,9 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { throw new Error('databaseName cannot be null or undefined and it must be of type string.'); } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -80,10 +79,10 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -167,111 +166,1095 @@ function _listByDatabase(resourceGroupName, serverName, databaseName, options, c }); } -/** Class representing a RestorePoints. */ -class RestorePoints { - /** - * Create a RestorePoints. - * @param {SqlManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDatabase = _listByDatabase; + +/** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _create(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - /** - * Gets a list of database restore points. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); }); + }); +} + +/** + * Gets a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, databaseName, restorePointName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (restorePointName === null || restorePointName === undefined || typeof restorePointName.valueOf() !== 'string') { + throw new Error('restorePointName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * Gets a list of database restore points. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database to get available - * restore points. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RestorePointListResult} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePointListResult} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{restorePointName}', encodeURIComponent(restorePointName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (restorePointName === null || restorePointName === undefined || typeof restorePointName.valueOf() !== 'string') { + throw new Error('restorePointName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{restorePointName}', encodeURIComponent(restorePointName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreate(resourceGroupName, serverName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CreateDatabaseRestorePointDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestorePoint']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a RestorePoints. */ +class RestorePoints { + /** + * Create a RestorePoints. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByDatabase = _listByDatabase; + this._create = _create; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._beginCreate = _beginCreate; + } + + /** + * Gets a list of database restore points. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByDatabaseWithHttpOperationResponse(resourceGroupName, serverName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of database restore points. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePointListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePointListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByDatabase(resourceGroupName, serverName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByDatabase(resourceGroupName, serverName, databaseName, options, optionalCallback); + } + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + create(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Gets a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, databaseName, restorePointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback); + } + } + + /** + * Deletes a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, databaseName, restorePointName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a restore point. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serverName, databaseName, restorePointName, options, optionalCallback); + } + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, serverName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a restore point for a data warehouse. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RestorePoint} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestorePoint} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, serverName, databaseName, parameters, options, optionalCallback); } } diff --git a/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js b/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js new file mode 100644 index 0000000000..80b3344111 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/serverAutomaticTuningOperations.js @@ -0,0 +1,539 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Retrieves server automatic tuning options. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Update automatic tuning options on server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, serverName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServerAutomaticTuning']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerAutomaticTuning']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServerAutomaticTuningOperations. */ +class ServerAutomaticTuningOperations { + /** + * Create a ServerAutomaticTuningOperations. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._update = _update; + } + + /** + * Retrieves server automatic tuning options. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Retrieves server automatic tuning options. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Update automatic tuning options on server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, serverName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Update automatic tuning options on server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} parameters The requested automatic tuning resource state. + * + * @param {string} [parameters.desiredState] Automatic tuning desired state. + * Possible values include: 'Custom', 'Auto', 'Unspecified' + * + * @param {object} [parameters.options] Automatic tuning options definition. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerAutomaticTuning} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerAutomaticTuning} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, serverName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, serverName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, serverName, parameters, options, optionalCallback); + } + } + +} + +module.exports = ServerAutomaticTuningOperations; diff --git a/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js b/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js index bf172a7edf..10775ded7e 100644 --- a/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js +++ b/lib/services/sqlManagement2/lib/operations/serverAzureADAdministrators.js @@ -793,7 +793,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -822,7 +822,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 202) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -839,7 +839,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { } } // Deserialize Response - if (statusCode === 204) { + if (statusCode === 202) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -856,7 +856,7 @@ function _beginDeleteMethod(resourceGroupName, serverName, options, callback) { } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 204) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); diff --git a/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js b/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js new file mode 100644 index 0000000000..9ca87bf521 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/serverDnsAliases.js @@ -0,0 +1,2014 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a server DNS alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a list of server DNS aliases for a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServer(resourceGroupName, serverName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAliasListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAlias']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (dnsAliasName === null || dnsAliasName === undefined || typeof dnsAliasName.valueOf() !== 'string') { + throw new Error('dnsAliasName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + requestUrl = requestUrl.replace('{dnsAliasName}', encodeURIComponent(dnsAliasName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServerDnsAliasAcquisition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServerNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServerDnsAliasListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ServerDnsAliases. */ +class ServerDnsAliases { + /** + * Create a ServerDnsAliases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByServer = _listByServer; + this._acquire = _acquire; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginAcquire = _beginAcquire; + this._listByServerNext = _listByServerNext; + } + + /** + * Gets a server DNS alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a server DNS alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + acquireWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._acquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback); + } + } + + /** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a server dns alias. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAlias} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the server DNS alias with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, serverName, dnsAliasName, options, optionalCallback); + } + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginAcquireWithHttpOperationResponse(resourceGroupName, serverName, dnsAliasName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Acquires server DNS alias from another server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginAcquire(resourceGroupName, serverName, dnsAliasName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of server DNS aliases for a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServerNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServerNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ServerDnsAliases; diff --git a/lib/services/sqlManagement2/lib/operations/serverKeys.js b/lib/services/sqlManagement2/lib/operations/serverKeys.js index 2562ae3491..54772dd044 100644 --- a/lib/services/sqlManagement2/lib/operations/serverKeys.js +++ b/lib/services/sqlManagement2/lib/operations/serverKeys.js @@ -617,7 +617,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, keyName, parameters return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/servers.js b/lib/services/sqlManagement2/lib/operations/servers.js index 7950917757..7d1ed28aff 100644 --- a/lib/services/sqlManagement2/lib/operations/servers.js +++ b/lib/services/sqlManagement2/lib/operations/servers.js @@ -980,7 +980,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, parameters, options return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js b/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js new file mode 100644 index 0000000000..829b0b17e0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/subscriptionUsages.js @@ -0,0 +1,701 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocation(locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(locationName, usageName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (usageName === null || usageName === undefined || typeof usageName.valueOf() !== 'string') { + throw new Error('usageName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{usageName}', encodeURIComponent(usageName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsage']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocationNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SubscriptionUsageListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a SubscriptionUsages. */ +class SubscriptionUsages { + /** + * Create a SubscriptionUsages. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByLocation = _listByLocation; + this._get = _get; + this._listByLocationNext = _listByLocationNext; + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocation(locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(locationName, options, optionalCallback); + } + } + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(locationName, usageName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(locationName, usageName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsage} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName, usageName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(locationName, usageName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(locationName, usageName, options, optionalCallback); + } + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = SubscriptionUsages; diff --git a/lib/services/sqlManagement2/lib/operations/syncAgents.js b/lib/services/sqlManagement2/lib/operations/syncAgents.js index 825cd5596d..2bf8c1b449 100644 --- a/lib/services/sqlManagement2/lib/operations/syncAgents.js +++ b/lib/services/sqlManagement2/lib/operations/syncAgents.js @@ -898,7 +898,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, syncAgentName, para return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/syncGroups.js b/lib/services/sqlManagement2/lib/operations/syncGroups.js index c5c13b03aa..3f3931980e 100644 --- a/lib/services/sqlManagement2/lib/operations/syncGroups.js +++ b/lib/services/sqlManagement2/lib/operations/syncGroups.js @@ -1737,7 +1737,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncG return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/syncMembers.js b/lib/services/sqlManagement2/lib/operations/syncMembers.js index b15b34186e..bdafcb363a 100644 --- a/lib/services/sqlManagement2/lib/operations/syncMembers.js +++ b/lib/services/sqlManagement2/lib/operations/syncMembers.js @@ -1038,7 +1038,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, databaseName, syncG return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js b/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js index c6662e454e..8fc3de45e4 100644 --- a/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js +++ b/lib/services/sqlManagement2/lib/operations/virtualNetworkRules.js @@ -596,7 +596,7 @@ function _beginCreateOrUpdate(resourceGroupName, serverName, virtualNetworkRuleN return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index e61fdb8712..951e647e01 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class SqlManagementClient extends AzureServiceClient { +export default class SqlManagementClient extends AzureServiceClient { /** * Initializes a new instance of the SqlManagementClient class. * @constructor @@ -53,12 +54,9 @@ declare class SqlManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups - backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; - backupLongTermRetentionVaults: operations.BackupLongTermRetentionVaults; - restorePoints: operations.RestorePoints; recoverableDatabases: operations.RecoverableDatabases; restorableDroppedDatabases: operations.RestorableDroppedDatabases; - capabilities: operations.Capabilities; + servers: operations.Servers; serverConnectionPolicies: operations.ServerConnectionPolicies; databaseThreatDetectionPolicies: operations.DatabaseThreatDetectionPolicies; dataMaskingPolicies: operations.DataMaskingPolicies; @@ -67,20 +65,20 @@ declare class SqlManagementClient extends AzureServiceClient { geoBackupPolicies: operations.GeoBackupPolicies; databases: operations.Databases; elasticPools: operations.ElasticPools; + recommendedElasticPools: operations.RecommendedElasticPools; replicationLinks: operations.ReplicationLinks; serverAzureADAdministrators: operations.ServerAzureADAdministrators; serverCommunicationLinks: operations.ServerCommunicationLinks; serviceObjectives: operations.ServiceObjectives; - servers: operations.Servers; elasticPoolActivities: operations.ElasticPoolActivities; elasticPoolDatabaseActivities: operations.ElasticPoolDatabaseActivities; - recommendedElasticPools: operations.RecommendedElasticPools; serviceTierAdvisors: operations.ServiceTierAdvisors; transparentDataEncryptions: operations.TransparentDataEncryptions; transparentDataEncryptionActivities: operations.TransparentDataEncryptionActivities; serverUsages: operations.ServerUsages; databaseUsages: operations.DatabaseUsages; databaseBlobAuditingPolicies: operations.DatabaseBlobAuditingPolicies; + databaseAutomaticTuningOperations: operations.DatabaseAutomaticTuningOperations; encryptionProtectors: operations.EncryptionProtectors; failoverGroups: operations.FailoverGroups; operations: operations.Operations; @@ -88,8 +86,16 @@ declare class SqlManagementClient extends AzureServiceClient { syncAgents: operations.SyncAgents; syncGroups: operations.SyncGroups; syncMembers: operations.SyncMembers; + subscriptionUsages: operations.SubscriptionUsages; virtualNetworkRules: operations.VirtualNetworkRules; + longTermRetentionBackups: operations.LongTermRetentionBackups; + backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; + serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; + serverDnsAliases: operations.ServerDnsAliases; + restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; + elasticPoolOperations: operations.ElasticPoolOperations; + capabilities: operations.Capabilities; } -export = SqlManagementClient; +export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index fcbe0c0d25..4c2f9a8ebd 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -71,12 +71,9 @@ class SqlManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } - this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); - this.backupLongTermRetentionVaults = new operations.BackupLongTermRetentionVaults(this); - this.restorePoints = new operations.RestorePoints(this); this.recoverableDatabases = new operations.RecoverableDatabases(this); this.restorableDroppedDatabases = new operations.RestorableDroppedDatabases(this); - this.capabilities = new operations.Capabilities(this); + this.servers = new operations.Servers(this); this.serverConnectionPolicies = new operations.ServerConnectionPolicies(this); this.databaseThreatDetectionPolicies = new operations.DatabaseThreatDetectionPolicies(this); this.dataMaskingPolicies = new operations.DataMaskingPolicies(this); @@ -85,20 +82,20 @@ class SqlManagementClient extends ServiceClient { this.geoBackupPolicies = new operations.GeoBackupPolicies(this); this.databases = new operations.Databases(this); this.elasticPools = new operations.ElasticPools(this); + this.recommendedElasticPools = new operations.RecommendedElasticPools(this); this.replicationLinks = new operations.ReplicationLinks(this); this.serverAzureADAdministrators = new operations.ServerAzureADAdministrators(this); this.serverCommunicationLinks = new operations.ServerCommunicationLinks(this); this.serviceObjectives = new operations.ServiceObjectives(this); - this.servers = new operations.Servers(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); this.serverUsages = new operations.ServerUsages(this); this.databaseUsages = new operations.DatabaseUsages(this); this.databaseBlobAuditingPolicies = new operations.DatabaseBlobAuditingPolicies(this); + this.databaseAutomaticTuningOperations = new operations.DatabaseAutomaticTuningOperations(this); this.encryptionProtectors = new operations.EncryptionProtectors(this); this.failoverGroups = new operations.FailoverGroups(this); this.operations = new operations.Operations(this); @@ -106,8 +103,16 @@ class SqlManagementClient extends ServiceClient { this.syncAgents = new operations.SyncAgents(this); this.syncGroups = new operations.SyncGroups(this); this.syncMembers = new operations.SyncMembers(this); + this.subscriptionUsages = new operations.SubscriptionUsages(this); this.virtualNetworkRules = new operations.VirtualNetworkRules(this); + this.longTermRetentionBackups = new operations.LongTermRetentionBackups(this); + this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); + this.serverAutomaticTuningOperations = new operations.ServerAutomaticTuningOperations(this); + this.serverDnsAliases = new operations.ServerDnsAliases(this); + this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); + this.elasticPoolOperations = new operations.ElasticPoolOperations(this); + this.capabilities = new operations.Capabilities(this); this.models = models; msRest.addSerializationMixin(this); } @@ -115,3 +120,6 @@ class SqlManagementClient extends ServiceClient { } module.exports = SqlManagementClient; +module.exports['default'] = SqlManagementClient; +module.exports.SqlManagementClient = SqlManagementClient; +module.exports.SqlManagementModels = models; diff --git a/lib/services/sqlManagement2/package.json b/lib/services/sqlManagement2/package.json index 1686f3a4fe..71add088c2 100644 --- a/lib/services/sqlManagement2/package.json +++ b/lib/services/sqlManagement2/package.json @@ -1,35 +1,22 @@ { "name": "azure-arm-sql", "author": "Microsoft Corporation", - "contributors": [ - "Moore, Jared" - ], - "version": "2.0.0", - "description": "Microsoft Azure SQL Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], - "keywords": [ - "node", - "azure" - ], - "main": "./lib/sqlManagementClient.js", - "types": "./lib/sqlManagementClient.d.ts", - "license": "MIT", + "description": "SqlManagementClient Library with typescript type definitions for node", + "version": "3.0.0", "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/sqlManagementClient.js", + "types": "./lib/sqlManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" } }