diff --git a/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js b/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js new file mode 100644 index 0000000000..65d3fbb01b --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/completeDatabaseRestoreDefinition.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Contains the information necessary to perform a complete database restore + * operation. + * + */ +class CompleteDatabaseRestoreDefinition { + /** + * Create a CompleteDatabaseRestoreDefinition. + * @member {string} lastBackupName The last backup name to apply + */ + constructor() { + } + + /** + * Defines the metadata of CompleteDatabaseRestoreDefinition + * + * @returns {object} metadata of CompleteDatabaseRestoreDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'CompleteDatabaseRestoreDefinition', + type: { + name: 'Composite', + className: 'CompleteDatabaseRestoreDefinition', + modelProperties: { + lastBackupName: { + required: true, + serializedName: 'lastBackupName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CompleteDatabaseRestoreDefinition; diff --git a/lib/services/sqlManagement2/lib/models/index.d.ts b/lib/services/sqlManagement2/lib/models/index.d.ts index e291789c89..fa1c535c36 100644 --- a/lib/services/sqlManagement2/lib/models/index.d.ts +++ b/lib/services/sqlManagement2/lib/models/index.d.ts @@ -1292,6 +1292,140 @@ export interface FailoverGroupUpdate { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the ResourceIdentity class. + * @constructor + * Azure Active Directory identity configuration for a resource. + * + * @member {uuid} [principalId] The Azure Active Directory principal id. + * @member {string} [type] The identity type. Set this to 'SystemAssigned' in + * order to automatically create and assign an Azure Active Directory principal + * for the resource. Possible values include: 'SystemAssigned' + * @member {uuid} [tenantId] The Azure Active Directory tenant id. + */ +export interface ResourceIdentity { + readonly principalId?: string; + type?: string; + readonly tenantId?: string; +} + +/** + * @class + * Initializes a new instance of the Sku class. + * @constructor + * An ARM Resource SKU. + * + * @member {string} name The name of the SKU, typically, a letter + Number + * code, e.g. P3. + * @member {string} [tier] The tier of the particular SKU, e.g. Basic, Premium. + * @member {string} [size] Size of the particular SKU + * @member {string} [family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [capacity] Capacity of the particular SKU. + */ +export interface Sku { + name: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; +} + +/** + * @class + * Initializes a new instance of the ManagedInstance class. + * @constructor + * An Azure SQL managed instance. + * + * @member {object} [identity] The Azure Active Directory identity of the + * managed instance. + * @member {uuid} [identity.principalId] The Azure Active Directory principal + * id. + * @member {string} [identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * @member {uuid} [identity.tenantId] The Azure Active Directory tenant id. + * @member {object} [sku] Managed instance sku + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain name + * of the managed instance. + * @member {string} [administratorLogin] Administrator username for the managed + * instance. Can only be specified when the managed instance is being created + * (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + */ +export interface ManagedInstance extends TrackedResource { + identity?: ResourceIdentity; + sku?: Sku; + readonly fullyQualifiedDomainName?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + subnetId?: string; + readonly state?: string; + licenseType?: string; + vCores?: number; + storageSizeInGB?: number; +} + +/** + * @class + * Initializes a new instance of the ManagedInstanceUpdate class. + * @constructor + * An update request for an Azure SQL Database managed instance. + * + * @member {object} [sku] Managed instance sku + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain name + * of the managed instance. + * @member {string} [administratorLogin] Administrator username for the managed + * instance. Can only be specified when the managed instance is being created + * (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + * @member {object} [tags] Resource tags. + */ +export interface ManagedInstanceUpdate { + sku?: Sku; + readonly fullyQualifiedDomainName?: string; + administratorLogin?: string; + administratorLoginPassword?: string; + subnetId?: string; + readonly state?: string; + licenseType?: string; + vCores?: number; + storageSizeInGB?: number; + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the OperationDisplay class. @@ -1368,24 +1502,6 @@ export interface ServerKey extends ProxyResource { creationDate?: Date; } -/** - * @class - * Initializes a new instance of the ResourceIdentity class. - * @constructor - * Azure Active Directory identity configuration for a resource. - * - * @member {uuid} [principalId] The Azure Active Directory principal id. - * @member {string} [type] The identity type. Set this to 'SystemAssigned' in - * order to automatically create and assign an Azure Active Directory principal - * for the resource. Possible values include: 'SystemAssigned' - * @member {uuid} [tenantId] The Azure Active Directory tenant id. - */ -export interface ResourceIdentity { - readonly principalId?: string; - type?: string; - readonly tenantId?: string; -} - /** * @class * Initializes a new instance of the Server class. @@ -1809,6 +1925,125 @@ export interface BackupLongTermRetentionPolicy extends ProxyResource { weekOfYear?: number; } +/** + * @class + * Initializes a new instance of the CompleteDatabaseRestoreDefinition class. + * @constructor + * Contains the information necessary to perform a complete database restore + * operation. + * + * @member {string} lastBackupName The last backup name to apply + */ +export interface CompleteDatabaseRestoreDefinition { + lastBackupName: string; +} + +/** + * @class + * Initializes a new instance of the ManagedDatabase class. + * @constructor + * A managed database resource. + * + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values include: + * 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + */ +export interface ManagedDatabase extends TrackedResource { + collation?: string; + readonly status?: string; + readonly creationDate?: Date; + readonly earliestRestorePoint?: Date; + restorePointInTime?: Date; + readonly defaultSecondaryLocation?: string; + catalogCollation?: string; + createMode?: string; + storageContainerUri?: string; + sourceDatabaseId?: string; + storageContainerSasToken?: string; + readonly failoverGroupId?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedDatabaseUpdate class. + * @constructor + * An managed database update. + * + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values include: + * 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + * @member {object} [tags] Resource tags. + */ +export interface ManagedDatabaseUpdate { + collation?: string; + readonly status?: string; + readonly creationDate?: Date; + readonly earliestRestorePoint?: Date; + restorePointInTime?: Date; + readonly defaultSecondaryLocation?: string; + catalogCollation?: string; + createMode?: string; + storageContainerUri?: string; + sourceDatabaseId?: string; + storageContainerSasToken?: string; + readonly failoverGroupId?: string; + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the AutomaticTuningServerOptions class. @@ -2082,28 +2317,6 @@ export interface PerformanceLevelCapability { readonly unit?: string; } -/** - * @class - * Initializes a new instance of the Sku class. - * @constructor - * An ARM Resource SKU. - * - * @member {string} name The name of the SKU, typically, a letter + Number - * code, e.g. P3. - * @member {string} [tier] The tier of the particular SKU, e.g. Basic, Premium. - * @member {string} [size] Size of the particular SKU - * @member {string} [family] If the service has different generations of - * hardware, for the same SKU, then that can be captured here. - * @member {number} [capacity] Capacity of the particular SKU. - */ -export interface Sku { - name: string; - tier?: string; - size?: string; - family?: string; - capacity?: number; -} - /** * @class * Initializes a new instance of the LicenseTypeCapability class. @@ -2853,6 +3066,109 @@ export interface ElasticPoolUpdate { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupReadWriteEndpoint class. + * @constructor + * Read-write endpoint of the failover group instance. + * + * @member {string} failoverPolicy Failover policy of the read-write endpoint + * for the failover group. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. Possible values include: + * 'Manual', 'Automatic' + * @member {number} [failoverWithDataLossGracePeriodMinutes] Grace period + * before failover with data loss is attempted for the read-write endpoint. If + * failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is + * required. + */ +export interface InstanceFailoverGroupReadWriteEndpoint { + failoverPolicy: string; + failoverWithDataLossGracePeriodMinutes?: number; +} + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupReadOnlyEndpoint class. + * @constructor + * Read-only endpoint of the failover group instance. + * + * @member {string} [failoverPolicy] Failover policy of the read-only endpoint + * for the failover group. Possible values include: 'Disabled', 'Enabled' + */ +export interface InstanceFailoverGroupReadOnlyEndpoint { + failoverPolicy?: string; +} + +/** + * @class + * Initializes a new instance of the PartnerRegionInfo class. + * @constructor + * Partner region information for the failover group. + * + * @member {string} [location] Geo location of the partner managed instances. + * @member {string} [replicationRole] Replication role of the partner managed + * instances. Possible values include: 'Primary', 'Secondary' + */ +export interface PartnerRegionInfo { + location?: string; + readonly replicationRole?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedInstancePairInfo class. + * @constructor + * Pairs of Managed Instances in the failover group. + * + * @member {string} [primaryManagedInstanceId] Id of Primary Managed Instance + * in pair. + * @member {string} [partnerManagedInstanceId] Id of Partner Managed Instance + * in pair. + */ +export interface ManagedInstancePairInfo { + primaryManagedInstanceId?: string; + partnerManagedInstanceId?: string; +} + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroup class. + * @constructor + * An instance failover group. + * + * @member {object} readWriteEndpoint Read-write endpoint of the failover group + * instance. + * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the + * read-write endpoint for the failover group. If failoverPolicy is Automatic + * then failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] + * Grace period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover group + * instance. + * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the + * read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * @member {string} [replicationRole] Local replication role of the failover + * group instance. Possible values include: 'Primary', 'Secondary' + * @member {string} [replicationState] Replication state of the failover group + * instance. + * @member {array} partnerRegions Partner region information for the failover + * group. + * @member {array} managedInstancePairs List of managed instance pairs in the + * failover group. + */ +export interface InstanceFailoverGroup extends ProxyResource { + readWriteEndpoint: InstanceFailoverGroupReadWriteEndpoint; + readOnlyEndpoint?: InstanceFailoverGroupReadOnlyEndpoint; + readonly replicationRole?: string; + readonly replicationState?: string; + partnerRegions: PartnerRegionInfo[]; + managedInstancePairs: ManagedInstancePairInfo[]; +} + /** * @class @@ -3105,6 +3421,18 @@ export interface FailoverGroupListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the ManagedInstanceListResult class. + * @constructor + * A list of managed instances. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface ManagedInstanceListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the OperationListResult class. @@ -3249,6 +3577,18 @@ export interface LongTermRetentionBackupListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the ServerDnsAliasListResult class. @@ -3296,3 +3636,15 @@ export interface DatabaseOperationListResult extends Array { export interface ElasticPoolOperationListResult extends Array { readonly nextLink?: string; } + +/** + * @class + * Initializes a new instance of the InstanceFailoverGroupListResult class. + * @constructor + * A list of instance failover groups. + * + * @member {string} [nextLink] Link to retrieve next page of results. + */ +export interface InstanceFailoverGroupListResult extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/sqlManagement2/lib/models/index.js b/lib/services/sqlManagement2/lib/models/index.js index eb58f54c80..bf52bd6905 100644 --- a/lib/services/sqlManagement2/lib/models/index.js +++ b/lib/services/sqlManagement2/lib/models/index.js @@ -65,10 +65,13 @@ exports.FailoverGroupReadOnlyEndpoint = require('./failoverGroupReadOnlyEndpoint exports.PartnerInfo = require('./partnerInfo'); exports.FailoverGroup = require('./failoverGroup'); exports.FailoverGroupUpdate = require('./failoverGroupUpdate'); +exports.ResourceIdentity = require('./resourceIdentity'); +exports.Sku = require('./sku'); +exports.ManagedInstance = require('./managedInstance'); +exports.ManagedInstanceUpdate = require('./managedInstanceUpdate'); exports.OperationDisplay = require('./operationDisplay'); exports.Operation = require('./operation'); exports.ServerKey = require('./serverKey'); -exports.ResourceIdentity = require('./resourceIdentity'); exports.Server = require('./server'); exports.ServerUpdate = require('./serverUpdate'); exports.SyncAgent = require('./syncAgent'); @@ -88,6 +91,9 @@ exports.SubscriptionUsage = require('./subscriptionUsage'); exports.VirtualNetworkRule = require('./virtualNetworkRule'); exports.LongTermRetentionBackup = require('./longTermRetentionBackup'); exports.BackupLongTermRetentionPolicy = require('./backupLongTermRetentionPolicy'); +exports.CompleteDatabaseRestoreDefinition = require('./completeDatabaseRestoreDefinition'); +exports.ManagedDatabase = require('./managedDatabase'); +exports.ManagedDatabaseUpdate = require('./managedDatabaseUpdate'); exports.AutomaticTuningServerOptions = require('./automaticTuningServerOptions'); exports.ServerAutomaticTuning = require('./serverAutomaticTuning'); exports.ServerDnsAlias = require('./serverDnsAlias'); @@ -100,7 +106,6 @@ exports.MaxSizeCapability = require('./maxSizeCapability'); exports.LogSizeCapability = require('./logSizeCapability'); exports.MaxSizeRangeCapability = require('./maxSizeRangeCapability'); exports.PerformanceLevelCapability = require('./performanceLevelCapability'); -exports.Sku = require('./sku'); exports.LicenseTypeCapability = require('./licenseTypeCapability'); exports.ServiceObjectiveCapability = require('./serviceObjectiveCapability'); exports.EditionCapability = require('./editionCapability'); @@ -120,6 +125,11 @@ exports.ResourceMoveDefinition = require('./resourceMoveDefinition'); exports.ElasticPoolPerDatabaseSettings = require('./elasticPoolPerDatabaseSettings'); exports.ElasticPool = require('./elasticPool'); exports.ElasticPoolUpdate = require('./elasticPoolUpdate'); +exports.InstanceFailoverGroupReadWriteEndpoint = require('./instanceFailoverGroupReadWriteEndpoint'); +exports.InstanceFailoverGroupReadOnlyEndpoint = require('./instanceFailoverGroupReadOnlyEndpoint'); +exports.PartnerRegionInfo = require('./partnerRegionInfo'); +exports.ManagedInstancePairInfo = require('./managedInstancePairInfo'); +exports.InstanceFailoverGroup = require('./instanceFailoverGroup'); exports.RecoverableDatabaseListResult = require('./recoverableDatabaseListResult'); exports.RestorableDroppedDatabaseListResult = require('./restorableDroppedDatabaseListResult'); exports.ServerListResult = require('./serverListResult'); @@ -144,6 +154,7 @@ exports.ServerUsageListResult = require('./serverUsageListResult'); exports.DatabaseUsageListResult = require('./databaseUsageListResult'); exports.EncryptionProtectorListResult = require('./encryptionProtectorListResult'); exports.FailoverGroupListResult = require('./failoverGroupListResult'); +exports.ManagedInstanceListResult = require('./managedInstanceListResult'); exports.OperationListResult = require('./operationListResult'); exports.ServerKeyListResult = require('./serverKeyListResult'); exports.SyncAgentListResult = require('./syncAgentListResult'); @@ -156,7 +167,9 @@ exports.SyncMemberListResult = require('./syncMemberListResult'); exports.SubscriptionUsageListResult = require('./subscriptionUsageListResult'); exports.VirtualNetworkRuleListResult = require('./virtualNetworkRuleListResult'); exports.LongTermRetentionBackupListResult = require('./longTermRetentionBackupListResult'); +exports.ManagedDatabaseListResult = require('./managedDatabaseListResult'); exports.ServerDnsAliasListResult = require('./serverDnsAliasListResult'); exports.RestorePointListResult = require('./restorePointListResult'); exports.DatabaseOperationListResult = require('./databaseOperationListResult'); exports.ElasticPoolOperationListResult = require('./elasticPoolOperationListResult'); +exports.InstanceFailoverGroupListResult = require('./instanceFailoverGroupListResult'); diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js new file mode 100644 index 0000000000..e9922cbba8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroup.js @@ -0,0 +1,158 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An instance failover group. + * + * @extends models['ProxyResource'] + */ +class InstanceFailoverGroup extends models['ProxyResource'] { + /** + * Create a InstanceFailoverGroup. + * @member {object} readWriteEndpoint Read-write endpoint of the failover + * group instance. + * @member {string} [readWriteEndpoint.failoverPolicy] Failover policy of the + * read-write endpoint for the failover group. If failoverPolicy is Automatic + * then failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} + * [readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace period + * before failover with data loss is attempted for the read-write endpoint. + * If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes + * is required. + * @member {object} [readOnlyEndpoint] Read-only endpoint of the failover + * group instance. + * @member {string} [readOnlyEndpoint.failoverPolicy] Failover policy of the + * read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * @member {string} [replicationRole] Local replication role of the failover + * group instance. Possible values include: 'Primary', 'Secondary' + * @member {string} [replicationState] Replication state of the failover + * group instance. + * @member {array} partnerRegions Partner region information for the failover + * group. + * @member {array} managedInstancePairs List of managed instance pairs in the + * failover group. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InstanceFailoverGroup + * + * @returns {object} metadata of InstanceFailoverGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroup', + type: { + name: 'Composite', + className: 'InstanceFailoverGroup', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + readWriteEndpoint: { + required: true, + serializedName: 'properties.readWriteEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadWriteEndpoint' + } + }, + readOnlyEndpoint: { + required: false, + serializedName: 'properties.readOnlyEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadOnlyEndpoint' + } + }, + replicationRole: { + required: false, + readOnly: true, + serializedName: 'properties.replicationRole', + type: { + name: 'String' + } + }, + replicationState: { + required: false, + readOnly: true, + serializedName: 'properties.replicationState', + type: { + name: 'String' + } + }, + partnerRegions: { + required: true, + serializedName: 'properties.partnerRegions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PartnerRegionInfoElementType', + type: { + name: 'Composite', + className: 'PartnerRegionInfo' + } + } + } + }, + managedInstancePairs: { + required: true, + serializedName: 'properties.managedInstancePairs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstancePairInfoElementType', + type: { + name: 'Composite', + className: 'ManagedInstancePairInfo' + } + } + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroup; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js new file mode 100644 index 0000000000..48f17c2c73 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of instance failover groups. + */ +class InstanceFailoverGroupListResult extends Array { + /** + * Create a InstanceFailoverGroupListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of InstanceFailoverGroupListResult + * + * @returns {object} metadata of InstanceFailoverGroupListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupListResult', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'InstanceFailoverGroupElementType', + type: { + name: 'Composite', + className: 'InstanceFailoverGroup' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupListResult; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js new file mode 100644 index 0000000000..a1ddd1b8a8 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadOnlyEndpoint.js @@ -0,0 +1,54 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Read-only endpoint of the failover group instance. + * + */ +class InstanceFailoverGroupReadOnlyEndpoint { + /** + * Create a InstanceFailoverGroupReadOnlyEndpoint. + * @member {string} [failoverPolicy] Failover policy of the read-only + * endpoint for the failover group. Possible values include: 'Disabled', + * 'Enabled' + */ + constructor() { + } + + /** + * Defines the metadata of InstanceFailoverGroupReadOnlyEndpoint + * + * @returns {object} metadata of InstanceFailoverGroupReadOnlyEndpoint + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupReadOnlyEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadOnlyEndpoint', + modelProperties: { + failoverPolicy: { + required: false, + serializedName: 'failoverPolicy', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupReadOnlyEndpoint; diff --git a/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js new file mode 100644 index 0000000000..860c661d76 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/instanceFailoverGroupReadWriteEndpoint.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Read-write endpoint of the failover group instance. + * + */ +class InstanceFailoverGroupReadWriteEndpoint { + /** + * Create a InstanceFailoverGroupReadWriteEndpoint. + * @member {string} failoverPolicy Failover policy of the read-write endpoint + * for the failover group. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. Possible values + * include: 'Manual', 'Automatic' + * @member {number} [failoverWithDataLossGracePeriodMinutes] Grace period + * before failover with data loss is attempted for the read-write endpoint. + * If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes + * is required. + */ + constructor() { + } + + /** + * Defines the metadata of InstanceFailoverGroupReadWriteEndpoint + * + * @returns {object} metadata of InstanceFailoverGroupReadWriteEndpoint + * + */ + mapper() { + return { + required: false, + serializedName: 'InstanceFailoverGroupReadWriteEndpoint', + type: { + name: 'Composite', + className: 'InstanceFailoverGroupReadWriteEndpoint', + modelProperties: { + failoverPolicy: { + required: true, + serializedName: 'failoverPolicy', + type: { + name: 'String' + } + }, + failoverWithDataLossGracePeriodMinutes: { + required: false, + serializedName: 'failoverWithDataLossGracePeriodMinutes', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = InstanceFailoverGroupReadWriteEndpoint; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabase.js b/lib/services/sqlManagement2/lib/models/managedDatabase.js new file mode 100644 index 0000000000..42e4dcefc4 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabase.js @@ -0,0 +1,213 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A managed database resource. + * + * @extends models['TrackedResource'] + */ +class ManagedDatabase extends models['TrackedResource'] { + /** + * Create a ManagedDatabase. + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values + * include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create + * the new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup + * of an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedDatabase + * + * @returns {object} metadata of ManagedDatabase + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabase', + type: { + name: 'Composite', + className: 'ManagedDatabase', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + collation: { + required: false, + serializedName: 'properties.collation', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + earliestRestorePoint: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestorePoint', + type: { + name: 'DateTime' + } + }, + restorePointInTime: { + required: false, + serializedName: 'properties.restorePointInTime', + type: { + name: 'DateTime' + } + }, + defaultSecondaryLocation: { + required: false, + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', + type: { + name: 'String' + } + }, + catalogCollation: { + required: false, + serializedName: 'properties.catalogCollation', + type: { + name: 'String' + } + }, + createMode: { + required: false, + serializedName: 'properties.createMode', + type: { + name: 'String' + } + }, + storageContainerUri: { + required: false, + serializedName: 'properties.storageContainerUri', + type: { + name: 'String' + } + }, + sourceDatabaseId: { + required: false, + serializedName: 'properties.sourceDatabaseId', + type: { + name: 'String' + } + }, + storageContainerSasToken: { + required: false, + serializedName: 'properties.storageContainerSasToken', + type: { + name: 'String' + } + }, + failoverGroupId: { + required: false, + readOnly: true, + serializedName: 'properties.failoverGroupId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedDatabase; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js b/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js new file mode 100644 index 0000000000..dcd44d94b3 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabaseListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of managed databases. + */ +class ManagedDatabaseListResult extends Array { + /** + * Create a ManagedDatabaseListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedDatabaseListResult + * + * @returns {object} metadata of ManagedDatabaseListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabaseListResult', + type: { + name: 'Composite', + className: 'ManagedDatabaseListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedDatabaseElementType', + type: { + name: 'Composite', + className: 'ManagedDatabase' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedDatabaseListResult; diff --git a/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js b/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js new file mode 100644 index 0000000000..8649d21350 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedDatabaseUpdate.js @@ -0,0 +1,179 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An managed database update. + * + */ +class ManagedDatabaseUpdate { + /** + * Create a ManagedDatabaseUpdate. + * @member {string} [collation] Collation of the managed database. + * @member {string} [status] Status for the database. Possible values + * include: 'Online', 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + * @member {date} [creationDate] Creation date of the database. + * @member {date} [earliestRestorePoint] Earliest restore point in time for + * point in time restore. + * @member {date} [restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create + * the new database. + * @member {string} [defaultSecondaryLocation] Geo paired region. + * @member {string} [catalogCollation] Collation of the metadata catalog. + * Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * @member {string} [createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup + * of an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * @member {string} [storageContainerUri] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * @member {string} [sourceDatabaseId] The resource identifier of the source + * database associated with create operation of this database. + * @member {string} [storageContainerSasToken] Conditional. If createMode is + * RestoreExternalBackup, this value is required. Specifies the storage + * container sas token. + * @member {string} [failoverGroupId] Instance Failover Group resource + * identifier that this managed database belongs to. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedDatabaseUpdate + * + * @returns {object} metadata of ManagedDatabaseUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedDatabaseUpdate', + type: { + name: 'Composite', + className: 'ManagedDatabaseUpdate', + modelProperties: { + collation: { + required: false, + serializedName: 'properties.collation', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'String' + } + }, + creationDate: { + required: false, + readOnly: true, + serializedName: 'properties.creationDate', + type: { + name: 'DateTime' + } + }, + earliestRestorePoint: { + required: false, + readOnly: true, + serializedName: 'properties.earliestRestorePoint', + type: { + name: 'DateTime' + } + }, + restorePointInTime: { + required: false, + serializedName: 'properties.restorePointInTime', + type: { + name: 'DateTime' + } + }, + defaultSecondaryLocation: { + required: false, + readOnly: true, + serializedName: 'properties.defaultSecondaryLocation', + type: { + name: 'String' + } + }, + catalogCollation: { + required: false, + serializedName: 'properties.catalogCollation', + type: { + name: 'String' + } + }, + createMode: { + required: false, + serializedName: 'properties.createMode', + type: { + name: 'String' + } + }, + storageContainerUri: { + required: false, + serializedName: 'properties.storageContainerUri', + type: { + name: 'String' + } + }, + sourceDatabaseId: { + required: false, + serializedName: 'properties.sourceDatabaseId', + type: { + name: 'String' + } + }, + storageContainerSasToken: { + required: false, + serializedName: 'properties.storageContainerSasToken', + type: { + name: 'String' + } + }, + failoverGroupId: { + required: false, + readOnly: true, + serializedName: 'properties.failoverGroupId', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedDatabaseUpdate; diff --git a/lib/services/sqlManagement2/lib/models/managedInstance.js b/lib/services/sqlManagement2/lib/models/managedInstance.js new file mode 100644 index 0000000000..bfef773885 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstance.js @@ -0,0 +1,198 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An Azure SQL managed instance. + * + * @extends models['TrackedResource'] + */ +class ManagedInstance extends models['TrackedResource'] { + /** + * Create a ManagedInstance. + * @member {object} [identity] The Azure Active Directory identity of the + * managed instance. + * @member {uuid} [identity.principalId] The Azure Active Directory principal + * id. + * @member {string} [identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure + * Active Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * @member {uuid} [identity.tenantId] The Azure Active Directory tenant id. + * @member {object} [sku] Managed instance sku + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain + * name of the managed instance. + * @member {string} [administratorLogin] Administrator username for the + * managed instance. Can only be specified when the managed instance is being + * created (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedInstance + * + * @returns {object} metadata of ManagedInstance + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstance', + type: { + name: 'Composite', + className: 'ManagedInstance', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'ResourceIdentity' + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + fullyQualifiedDomainName: { + required: false, + readOnly: true, + serializedName: 'properties.fullyQualifiedDomainName', + type: { + name: 'String' + } + }, + administratorLogin: { + required: false, + serializedName: 'properties.administratorLogin', + type: { + name: 'String' + } + }, + administratorLoginPassword: { + required: false, + serializedName: 'properties.administratorLoginPassword', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vCores: { + required: false, + serializedName: 'properties.vCores', + type: { + name: 'Number' + } + }, + storageSizeInGB: { + required: false, + serializedName: 'properties.storageSizeInGB', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = ManagedInstance; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceListResult.js b/lib/services/sqlManagement2/lib/models/managedInstanceListResult.js new file mode 100644 index 0000000000..a6b27f7ebf --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A list of managed instances. + */ +class ManagedInstanceListResult extends Array { + /** + * Create a ManagedInstanceListResult. + * @member {string} [nextLink] Link to retrieve next page of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ManagedInstanceListResult + * + * @returns {object} metadata of ManagedInstanceListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceListResult', + type: { + name: 'Composite', + className: 'ManagedInstanceListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ManagedInstanceElementType', + type: { + name: 'Composite', + className: 'ManagedInstance' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceListResult; diff --git a/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js b/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js new file mode 100644 index 0000000000..c352f8d74c --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstancePairInfo.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Pairs of Managed Instances in the failover group. + * + */ +class ManagedInstancePairInfo { + /** + * Create a ManagedInstancePairInfo. + * @member {string} [primaryManagedInstanceId] Id of Primary Managed Instance + * in pair. + * @member {string} [partnerManagedInstanceId] Id of Partner Managed Instance + * in pair. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstancePairInfo + * + * @returns {object} metadata of ManagedInstancePairInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstancePairInfo', + type: { + name: 'Composite', + className: 'ManagedInstancePairInfo', + modelProperties: { + primaryManagedInstanceId: { + required: false, + serializedName: 'primaryManagedInstanceId', + type: { + name: 'String' + } + }, + partnerManagedInstanceId: { + required: false, + serializedName: 'partnerManagedInstanceId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedInstancePairInfo; diff --git a/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js b/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js new file mode 100644 index 0000000000..0e6ca36d12 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/managedInstanceUpdate.js @@ -0,0 +1,149 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * An update request for an Azure SQL Database managed instance. + * + */ +class ManagedInstanceUpdate { + /** + * Create a ManagedInstanceUpdate. + * @member {object} [sku] Managed instance sku + * @member {string} [sku.name] The name of the SKU, typically, a letter + + * Number code, e.g. P3. + * @member {string} [sku.tier] The tier of the particular SKU, e.g. Basic, + * Premium. + * @member {string} [sku.size] Size of the particular SKU + * @member {string} [sku.family] If the service has different generations of + * hardware, for the same SKU, then that can be captured here. + * @member {number} [sku.capacity] Capacity of the particular SKU. + * @member {string} [fullyQualifiedDomainName] The fully qualified domain + * name of the managed instance. + * @member {string} [administratorLogin] Administrator username for the + * managed instance. Can only be specified when the managed instance is being + * created (and is required for creation). + * @member {string} [administratorLoginPassword] The administrator login + * password (required for managed instance creation). + * @member {string} [subnetId] Subnet resource ID for the managed instance. + * @member {string} [state] The state of the managed instance. + * @member {string} [licenseType] The license type. Possible values are + * 'LicenseIncluded' and 'BasePrice'. + * @member {number} [vCores] The number of VCores. + * @member {number} [storageSizeInGB] The maximum storage size in GB. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedInstanceUpdate + * + * @returns {object} metadata of ManagedInstanceUpdate + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedInstanceUpdate', + type: { + name: 'Composite', + className: 'ManagedInstanceUpdate', + modelProperties: { + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + fullyQualifiedDomainName: { + required: false, + readOnly: true, + serializedName: 'properties.fullyQualifiedDomainName', + type: { + name: 'String' + } + }, + administratorLogin: { + required: false, + serializedName: 'properties.administratorLogin', + type: { + name: 'String' + } + }, + administratorLoginPassword: { + required: false, + serializedName: 'properties.administratorLoginPassword', + type: { + name: 'String' + } + }, + subnetId: { + required: false, + serializedName: 'properties.subnetId', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + licenseType: { + required: false, + serializedName: 'properties.licenseType', + type: { + name: 'String' + } + }, + vCores: { + required: false, + serializedName: 'properties.vCores', + type: { + name: 'Number' + } + }, + storageSizeInGB: { + required: false, + serializedName: 'properties.storageSizeInGB', + type: { + name: 'Number' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedInstanceUpdate; diff --git a/lib/services/sqlManagement2/lib/models/partnerRegionInfo.js b/lib/services/sqlManagement2/lib/models/partnerRegionInfo.js new file mode 100644 index 0000000000..dc0b958260 --- /dev/null +++ b/lib/services/sqlManagement2/lib/models/partnerRegionInfo.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Partner region information for the failover group. + * + */ +class PartnerRegionInfo { + /** + * Create a PartnerRegionInfo. + * @member {string} [location] Geo location of the partner managed instances. + * @member {string} [replicationRole] Replication role of the partner managed + * instances. Possible values include: 'Primary', 'Secondary' + */ + constructor() { + } + + /** + * Defines the metadata of PartnerRegionInfo + * + * @returns {object} metadata of PartnerRegionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'PartnerRegionInfo', + type: { + name: 'Composite', + className: 'PartnerRegionInfo', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + replicationRole: { + required: false, + readOnly: true, + serializedName: 'replicationRole', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PartnerRegionInfo; diff --git a/lib/services/sqlManagement2/lib/operations/index.d.ts b/lib/services/sqlManagement2/lib/operations/index.d.ts index c753734bba..a128bea671 100644 --- a/lib/services/sqlManagement2/lib/operations/index.d.ts +++ b/lib/services/sqlManagement2/lib/operations/index.d.ts @@ -10710,15 +10710,15 @@ export interface FailoverGroups { /** * @class - * Operations + * ManagedInstances * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface Operations { +export interface ManagedInstances { /** - * Lists all of the available SQL Rest API operations. + * Gets a list of all managed instances in the subscription. * * @param {object} [options] Optional Parameters. * @@ -10727,14 +10727,14 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of all managed instances in the subscription. * * @param {object} [options] Optional Parameters. * @@ -10748,7 +10748,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10756,23 +10756,25 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of managed instances in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * * @param {object} [options] Optional Parameters. * @@ -10781,17 +10783,18 @@ export interface Operations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all of the available SQL Rest API operations. + * Gets a list of managed instances in a resource group. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * * @param {object} [options] Optional Parameters. * @@ -10805,7 +10808,7 @@ export interface Operations { * * {Promise} A promise is returned. * - * @resolve {OperationListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10813,35 +10816,27 @@ export interface Operations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {OperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link OperationListResult} for more information. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ServerKeys - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ServerKeys { + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server keys. + * Gets a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -10850,20 +10845,20 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server keys. + * Gets a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -10877,7 +10872,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10885,159 +10880,140 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server key. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' * - * @returns {Promise} A promise is returned + * @param {object} [parameters.sku] Managed instance sku * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a server key. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} serverName The name of the server. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} keyName The name of the server key to be retrieved. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * {Promise} A promise is returned. + * @param {number} [parameters.vCores] The number of VCores. * - * @resolve {ServerKey} - The deserialized result object. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @reject {Error|ServiceError} - The error object. + * @param {object} [parameters.tags] Resource tags. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} parameters.location Resource location. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [options] Optional Parameters. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @returns {Promise} A promise is returned * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. */ - get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 - * - * @param {object} parameters The requested server key resource state. - * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. - * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {object} parameters The requested managed instance resource state. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' * - * @param {object} [options] Optional Parameters. + * @param {object} [parameters.sku] Managed instance sku * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @returns {Promise} A promise is returned + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates a server key. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * @param {string} serverName The name of the server. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {object} parameters The requested server key resource state. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {number} [parameters.vCores] The number of VCores. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {object} [parameters.tags] Resource tags. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11051,7 +11027,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11059,28 +11035,26 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11093,18 +11067,16 @@ export interface ServerKeys { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be deleted. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11132,41 +11104,55 @@ export interface ServerKeys { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a server key. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {object} parameters The requested managed instance resource state. * - * @param {object} parameters The requested server key resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11175,42 +11161,56 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a server key. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be operated on - * (updated or created). The key name is required to be in the format of - * 'vault_key_version'. For example, if the keyId is - * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, - * then the server key name should be formatted as: - * YourVaultName_YourKeyName_01234567890123456789012345678901 + * @param {string} managedInstanceName The name of the managed instance. * - * @param {object} parameters The requested server key resource state. + * @param {object} parameters The requested managed instance resource state. * - * @param {string} [parameters.kind] Kind of encryption protector. This is - * metadata used for the Azure portal experience. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} parameters.serverKeyType The server key type like - * 'ServiceManaged', 'AzureKeyVault'. Possible values include: - * 'ServiceManaged', 'AzureKeyVault' + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * @param {string} [parameters.uri] The URI of the server key. + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * @param {date} [parameters.creationDate] The server key creation date. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11224,7 +11224,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKey} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11232,28 +11232,72 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKey} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKey} for more information. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the server key with the given name. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} keyName The name of the server key to be deleted. + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11262,78 +11306,66 @@ export interface ServerKeys { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server key with the given name. + * Creates or updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} keyName The name of the server key to be deleted. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} managedInstanceName The name of the managed instance. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters The requested managed instance resource state. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. * - * {Promise} A promise is returned. + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' * - * @resolve {null} - The deserialized result object. + * @param {object} [parameters.sku] Managed instance sku * - * @reject {Error|ServiceError} - The error object. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [parameters.sku.size] Size of the particular SKU * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets a list of server keys. + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). * - * @param {object} [options] Optional Parameters. + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. * - * @returns {Promise} A promise is returned + * @param {number} [parameters.vCores] The number of VCores. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. * - * @reject {Error|ServiceError} - The error object. - */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a list of server keys. + * @param {object} [parameters.tags] Resource tags. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -11347,7 +11379,7 @@ export interface ServerKeys { * * {Promise} A promise is returned. * - * @resolve {ServerKeyListResult} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11355,38 +11387,26 @@ export interface ServerKeys { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerKeyListResult} for more information. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncAgents - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncAgents { + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstance, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync agent. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11395,23 +11415,20 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync agent. + * Deletes a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -11425,7 +11442,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11433,34 +11450,61 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync agent. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} syncAgentName The name of the sync agent. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} parameters The requested sync agent resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11469,28 +11513,56 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Updates a managed instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} syncAgentName The name of the sync agent. + * @param {object} parameters The requested managed instance resource state. * - * @param {object} parameters The requested sync agent resource state. + * @param {object} [parameters.sku] Managed instance sku * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -11504,7 +11576,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {ManagedInstance} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11512,29 +11584,23 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {ManagedInstance} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, parameters: models.ManagedInstanceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync agent. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * Gets a list of all managed instances in the subscription. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11543,23 +11609,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Gets a list of all managed instances in the subscription. * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11573,7 +11633,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11581,26 +11641,24 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a list of managed instances in a resource group. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11609,21 +11667,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. + * Gets a list of managed instances in a resource group. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11637,7 +11691,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @resolve {ManagedInstanceListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11645,29 +11699,30 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {ManagedInstanceListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface Operations { /** - * Generates a sync agent key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -11676,23 +11731,14 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Generates a sync agent key. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. + * Lists all of the available SQL Rest API operations. * * @param {object} [options] Optional Parameters. * @@ -11706,7 +11752,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentKeyProperties} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11714,30 +11760,23 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentKeyProperties} for more - * information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * Lists all of the available SQL Rest API operations. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11746,23 +11785,17 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * Lists all of the available SQL Rest API operations. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -11776,7 +11809,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {OperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11784,35 +11817,35 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more - * information. + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerKeys + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerKeys { /** - * Creates or updates a sync agent. + * Gets a list of server keys. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. - * - * @param {object} parameters The requested sync agent resource state. - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -11821,28 +11854,20 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync agent. + * Gets a list of server keys. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. - * - * @param {string} syncAgentName The name of the sync agent. - * - * @param {object} parameters The requested sync agent resource state. - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync agent. + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * @@ -11856,7 +11881,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgent} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11864,29 +11889,28 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgent} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgent} for more information. + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync agent. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -11895,23 +11919,22 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync agent. + * Gets a server key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server on which the sync agent is - * hosted. + * @param {string} serverName The name of the server. * - * @param {string} syncAgentName The name of the sync agent. + * @param {string} keyName The name of the server key to be retrieved. * * @param {object} [options] Optional Parameters. * @@ -11925,7 +11948,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11933,22 +11956,48 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync agents in a server. + * Creates or updates a server key. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -11957,31 +12006,56 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync agents in a server. + * Creates or updates a server key. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {object} parameters The requested server key resource state. * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. * - * {Promise} A promise is returned. + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' * - * @resolve {SyncAgentListResult} - The deserialized result object. + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -11989,23 +12063,28 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentListResult} for more information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServerNext(nextPageLink: string, callback: ServiceCallback): void; - listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists databases linked to a sync agent. + * Deletes the server key with the given name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12014,17 +12093,22 @@ export interface SyncAgents { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists databases linked to a sync agent. + * Deletes the server key with the given name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12038,7 +12122,7 @@ export interface SyncAgents { * * {Promise} A promise is returned. * - * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12046,33 +12130,47 @@ export interface SyncAgents { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncAgentLinkedDatabaseListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; - listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncGroups { + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync database ids. + * Creates or updates a server key. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -12081,17 +12179,42 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Creates or updates a server key. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} keyName The name of the server key to be operated on + * (updated or created). The key name is required to be in the format of + * 'vault_key_version'. For example, if the keyId is + * https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + * then the server key name should be formatted as: + * YourVaultName_YourKeyName_01234567890123456789012345678901 + * + * @param {object} parameters The requested server key resource state. + * + * @param {string} [parameters.kind] Kind of encryption protector. This is + * metadata used for the Azure portal experience. + * + * @param {string} parameters.serverKeyType The server key type like + * 'ServiceManaged', 'AzureKeyVault'. Possible values include: + * 'ServiceManaged', 'AzureKeyVault' + * + * @param {string} [parameters.uri] The URI of the server key. + * + * @param {string} [parameters.thumbprint] Thumbprint of the server key. + * + * @param {date} [parameters.creationDate] The server key creation date. * * @param {object} [options] Optional Parameters. * @@ -12105,7 +12228,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {ServerKey} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12113,21 +12236,20 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more - * information. + * {ServerKey} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKey} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; - listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, keyName: string, parameters: models.ServerKey, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12135,10 +12257,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12151,10 +12270,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. + * Deletes the server key with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -12162,10 +12281,7 @@ export interface SyncGroups { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} keyName The name of the server key to be deleted. * * @param {object} [options] Optional Parameters. * @@ -12193,24 +12309,16 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, keyName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets a list of server keys. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12219,25 +12327,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Gets a list of server keys. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12251,7 +12351,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {ServerKeyListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12259,82 +12359,66 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {ServerKeyListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerKeyListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncAgents + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncAgents { /** - * Gets a collection of sync group logs. + * Gets a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync group logs. + * Gets a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {string} startTime Get logs generated after this time. - * - * @param {string} endTime Get logs generated before this time. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} type The types of logs to retrieve. Possible values include: - * 'All', 'Error', 'Warning', 'Success' + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.continuationToken] The continuation token for this - * operation. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -12345,7 +12429,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupLogListResult} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12353,32 +12437,34 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more - * information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; - listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels a sync group synchronization. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12387,25 +12473,28 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels a sync group synchronization. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} syncGroupName The name of the sync group. + * @param {object} parameters The requested sync agent resource state. + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12419,7 +12508,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12427,30 +12516,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Triggers a sync group synchronization. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12463,21 +12551,19 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Triggers a sync group synchronization. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12505,24 +12591,20 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync group. + * Lists sync agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -12531,25 +12613,21 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync group. + * Lists sync agents in a server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * * @param {object} [options] Optional Parameters. * @@ -12563,7 +12641,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12571,55 +12649,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync group. + * Generates a sync agent key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12628,49 +12680,23 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + generateKeyWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. + * Generates a sync agent key. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12684,7 +12710,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentKeyProperties} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12692,31 +12718,30 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {SyncAgentKeyProperties} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentKeyProperties} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + generateKey(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync group. + * Lists databases linked to a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12725,25 +12750,23 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * Lists databases linked to a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12757,7 +12780,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12765,54 +12788,35 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + listLinkedDatabases(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @param {object} parameters The requested sync agent resource state. * * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. - * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12821,49 +12825,28 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. + * Creates or updates a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {number} [parameters.interval] Sync interval of the sync group. + * @param {string} syncAgentName The name of the sync agent. * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * @param {object} parameters The requested sync agent resource state. * * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. - * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * database in the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12877,7 +12860,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgent} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12885,29 +12868,29 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {SyncAgent} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgent} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, syncAgentName: string, parameters: models.SyncAgent, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync groups under a hub database. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12916,23 +12899,23 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. + * Deletes a sync agent. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server on which the sync agent is + * hosted. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * @param {string} syncAgentName The name of the sync agent. * * @param {object} [options] Optional Parameters. * @@ -12946,7 +12929,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12954,31 +12937,22 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, syncAgentName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a hub database schema. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Lists sync agents in a server. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -12987,25 +12961,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a hub database schema. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. + * Lists sync agents in a server. * - * @param {string} syncGroupName The name of the sync group. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13019,7 +12985,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncAgentListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13027,54 +12993,23 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncAgentListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * Lists databases linked to a sync agent. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13083,49 +13018,17 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLinkedDatabasesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync group. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group. - * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. + * Lists databases linked to a sync agent. * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -13139,7 +13042,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncAgentLinkedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13147,20 +13050,88 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {SyncAgentLinkedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncAgentLinkedDatabaseListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + listLinkedDatabasesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLinkedDatabasesNext(nextPageLink: string, callback: ServiceCallback): void; + listLinkedDatabasesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} - /** - * Deletes a sync group. +/** + * @class + * SyncGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncGroups { + + + /** + * Gets a collection of sync database ids. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncDatabaseIdsWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync database ids. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncDatabaseIds(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIds(locationName: string, callback: ServiceCallback): void; + listSyncDatabaseIds(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13184,10 +13155,10 @@ export interface SyncGroups { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + refreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync group. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13226,13 +13197,13 @@ export interface SyncGroups { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + refreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a sync group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13245,30 +13216,6 @@ export interface SyncGroups { * * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. - * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13276,14 +13223,14 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listHubSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a sync group. + * Gets a collection of hub database schemas. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13296,30 +13243,6 @@ export interface SyncGroups { * * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync group resource state. - * - * @param {number} [parameters.interval] Sync interval of the sync group. - * - * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution - * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' - * - * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync - * database in the sync group. - * - * @param {string} [parameters.hubDatabaseUserName] User name for the sync - * group hub database credential. - * - * @param {string} [parameters.hubDatabasePassword] Password for the sync group - * hub database credential. - * - * @param {object} [parameters.schema] Sync schema of the sync group. - * - * @param {array} [parameters.schema.tables] List of tables in sync group - * schema. - * - * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync - * member where the schema is from. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -13332,7 +13255,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroup} - The deserialized result object. + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13340,45 +13263,82 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroup} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroup} for more information. + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listHubSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync database ids. + * Gets a collection of sync group logs. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {string} startTime Get logs generated after this time. + * + * @param {string} endTime Get logs generated before this time. + * + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listLogsWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of sync database ids. + * Gets a collection of sync group logs. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {string} startTime Get logs generated after this time. + * + * @param {string} endTime Get logs generated before this time. + * + * @param {string} type The types of logs to retrieve. Possible values include: + * 'All', 'Error', 'Warning', 'Success' * * @param {object} [options] Optional Parameters. * + * @param {string} [options.continuationToken] The continuation token for this + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -13389,7 +13349,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * @resolve {SyncGroupLogListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13397,24 +13357,32 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncDatabaseIdListResult} for more + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; - listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options?: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, callback: ServiceCallback): void; + listLogs(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, startTime: string, endTime: string, type: string, options: { continuationToken? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of hub database schemas. + * Cancels a sync group synchronization. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13423,17 +13391,25 @@ export interface SyncGroups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a collection of hub database schemas. + * Cancels a sync group synchronization. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13447,7 +13423,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13455,101 +13431,57 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + cancelSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a collection of sync group logs. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Triggers a sync group synchronization. * - * @returns {Promise} A promise is returned + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} serverName The name of the server. * - * @reject {Error|ServiceError} - The error object. - */ - listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets a collection of sync group logs. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SyncGroupLogListResult} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupLogListResult} for more - * information. + * @returns {Promise} A promise is returned * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @reject {Error|ServiceError} - The error object. */ - listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listLogsNext(nextPageLink: string, callback: ServiceCallback): void; - listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + triggerSyncWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync groups under a hub database. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * Triggers a sync group synchronization. * - * @returns {Promise} A promise is returned + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} serverName The name of the server. * - * @reject {Error|ServiceError} - The error object. - */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Lists sync groups under a hub database. + * @param {string} databaseName The name of the database on which the sync + * group is hosted. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13563,7 +13495,7 @@ export interface SyncGroups { * * {Promise} A promise is returned. * - * @resolve {SyncGroupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13571,29 +13503,19 @@ export interface SyncGroups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncGroupListResult} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SyncMembers - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SyncMembers { + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + triggerSync(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member. + * Gets a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13604,10 +13526,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13616,14 +13535,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member. + * Gets a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13634,10 +13553,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13651,7 +13567,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13659,20 +13575,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync member. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13683,37 +13599,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13722,14 +13632,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13740,37 +13650,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13784,7 +13688,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -13792,20 +13696,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a sync member. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13816,10 +13720,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13832,10 +13733,10 @@ export interface SyncMembers { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13846,10 +13747,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -13877,13 +13775,13 @@ export interface SyncMembers { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an existing sync member. + * Updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13894,37 +13792,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13933,14 +13825,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. + * Updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -13951,37 +13843,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * - * @param {object} parameters The requested sync member resource state. + * @param {object} parameters The requested sync group resource state. * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {number} [parameters.interval] Sync interval of the sync group. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. + * @param {object} [parameters.schema] Sync schema of the sync group. * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -13995,7 +13881,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14003,20 +13889,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMember} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMember} for more information. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; - update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists sync members in the given sync group. + * Lists sync groups under a hub database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14027,8 +13913,6 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14036,14 +13920,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Lists sync groups under a hub database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14054,8 +13938,6 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -14068,7 +13950,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {SyncGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14076,20 +13958,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncMemberListResult} for more information. + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; - listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a sync member database schema. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14100,10 +13982,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14112,14 +13991,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRefreshHubSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a sync member database schema. + * Refreshes a hub database schema. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14130,10 +14009,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14147,7 +14023,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14155,21 +14031,19 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SyncFullSchemaPropertiesListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginRefreshHubSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Refreshes a sync member database schema. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14180,10 +14054,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -14192,14 +14087,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Creates or updates a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14210,10 +14105,31 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. * * @param {object} [options] Optional Parameters. * @@ -14227,7 +14143,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {SyncGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14235,19 +14151,20 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; - refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a sync member. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14258,37 +14175,7 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. - * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} syncGroupName The name of the sync group. * * @param {object} [options] Optional Parameters. * @@ -14297,14 +14184,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a sync member. + * Deletes a sync group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14315,37 +14202,2732 @@ export interface SyncMembers { * @param {string} databaseName The name of the database on which the sync * group is hosted. * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * @param {string} syncGroupName The name of the sync group. * - * @param {string} syncMemberName The name of the sync member. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The requested sync member resource state. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * 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 {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates a sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates a sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} parameters The requested sync group resource state. + * + * @param {number} [parameters.interval] Sync interval of the sync group. + * + * @param {string} [parameters.conflictResolutionPolicy] Conflict resolution + * policy of the sync group. Possible values include: 'HubWin', 'MemberWin' + * + * @param {string} [parameters.syncDatabaseId] ARM resource id of the sync + * database in the sync group. + * + * @param {string} [parameters.hubDatabaseUserName] User name for the sync + * group hub database credential. + * + * @param {string} [parameters.hubDatabasePassword] Password for the sync group + * hub database credential. + * + * @param {object} [parameters.schema] Sync schema of the sync group. + * + * @param {array} [parameters.schema.tables] List of tables in sync group + * schema. + * + * @param {string} [parameters.schema.masterSyncMemberName] Name of master sync + * member where the schema is from. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncGroup} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncGroup} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroup} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, parameters: models.SyncGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a collection of sync database ids. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncDatabaseIdsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync database ids. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncDatabaseIdListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncDatabaseIdListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncDatabaseIdListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncDatabaseIdsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncDatabaseIdsNext(nextPageLink: string, callback: ServiceCallback): void; + listSyncDatabaseIdsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a collection of hub database schemas. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHubSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of hub database schemas. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHubSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHubSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listHubSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a collection of sync group logs. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listLogsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a collection of sync group logs. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncGroupLogListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncGroupLogListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupLogListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listLogsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listLogsNext(nextPageLink: string, callback: ServiceCallback): void; + listLogsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists sync groups under a hub database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists sync groups under a hub database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncGroupListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncGroupListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SyncMembers + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SyncMembers { + + + /** + * Gets a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMember} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMember} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMember} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + update(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists sync members in the given sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBySyncGroupWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists sync members in the given sync group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMemberListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, callback: ServiceCallback): void; + listBySyncGroup(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMemberSchemasWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + listMemberSchemas(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Refreshes a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + refreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Refreshes a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + refreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMember} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates an existing sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates an existing sync member. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} parameters The requested sync member resource state. + * + * @param {string} [parameters.databaseType] Database type of the sync member. + * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' + * + * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent + * in the sync member. + * + * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the + * sync member. + * + * @param {string} [parameters.serverName] Server name of the member database + * in the sync member + * + * @param {string} [parameters.databaseName] Database name of the member + * database in the sync member. + * + * @param {string} [parameters.userName] User name of the member database in + * the sync member. + * + * @param {string} [parameters.password] Password of the member database in the + * sync member. + * + * @param {string} [parameters.syncDirection] Sync direction of the sync + * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', + * 'OneWayHubToMember' + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMember} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMember} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMember} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Refreshes a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Refreshes a sync member database schema. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database on which the sync + * group is hosted. + * + * @param {string} syncGroupName The name of the sync group on which the sync + * member is hosted. + * + * @param {string} syncMemberName The name of the sync member. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, callback: ServiceCallback): void; + beginRefreshMemberSchema(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists sync members in the given sync group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists sync members in the given sync group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncMemberListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncMemberListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncMemberListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listBySyncGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySyncGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listBySyncGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a sync member database schema. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMemberSchemasNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a sync member database schema. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SyncFullSchemaPropertiesListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SyncFullSchemaPropertiesListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; + listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * SubscriptionUsages + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface SubscriptionUsages { + + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a subscription usage metric. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} usageName Name of usage metric to return. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SubscriptionUsage} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionUsage} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsage} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, usageName: string, callback: ServiceCallback): void; + get(locationName: string, usageName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets all subscription usage metrics in a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SubscriptionUsageListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; + listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * VirtualNetworkRules + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface VirtualNetworkRules { + + + /** + * Gets a virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an existing virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an existing virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the virtual network rule with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the virtual network rule with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual network rules in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual network rules in a server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Creates or updates an existing virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates or updates an existing virtual network rule. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} parameters The requested virtual Network Rule Resource + * state. + * + * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the + * virtual network subnet. + * + * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create + * firewall rule before the virtual network has vnet service endpoint enabled. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkRule} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRule} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes the virtual network rule with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes the virtual network rule with the given name. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets a list of virtual network rules in a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of virtual network rules in a server. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {VirtualNetworkRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link VirtualNetworkRuleListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * LongTermRetentionBackups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface LongTermRetentionBackups { + + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a long term retention backup. + * + * @param {string} locationName The location of the database. + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LongTermRetentionBackup} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackup} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + get(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + deleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all long term retention backups for a database. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, callback: ServiceCallback): void; + listByDatabase(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the long term retention backups for a given location. + * + * @param {string} locationName The location of the database + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the long term retention backups for a given server. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get + * the latest backup for each database. + * + * @param {string} [options.databaseState] Whether to query against just live + * databases, just deleted databases, or all databases. Possible values + * include: 'All', 'Live', 'Deleted' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; + listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a long term retention backup. + * + * @param {string} locationName The location of the database + * + * @param {string} longTermRetentionServerName + * + * @param {string} longTermRetentionDatabaseName + * + * @param {string} backupName The backup name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, callback: ServiceCallback): void; + beginDeleteMethod(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all long term retention backups for a database. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. * - * @param {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. + */ + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all long term retention backups for a database. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14359,7 +16941,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14367,34 +16949,24 @@ 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. + * {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, 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; + 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; /** - * Deletes a sync member. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * Lists the long term retention backups for a given location. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14403,28 +16975,17 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a sync member. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. + * Lists the long term retention backups for a given location. * - * @param {string} syncMemberName The name of the sync member. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14438,7 +16999,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14446,60 +17007,24 @@ 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. + * {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, 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; + 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; /** - * Updates an existing sync member. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * Lists the long term retention backups for a given server. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14508,55 +17033,17 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, parameters: models.SyncMember, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an existing sync member. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. - * - * @param {object} parameters The requested sync member resource state. - * - * @param {string} [parameters.databaseType] Database type of the sync member. - * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase' - * - * @param {string} [parameters.syncAgentId] ARM resource id of the sync agent - * in the sync member. - * - * @param {uuid} [parameters.sqlServerDatabaseId] SQL Server database id of the - * sync member. - * - * @param {string} [parameters.serverName] Server name of the member database - * in the sync member - * - * @param {string} [parameters.databaseName] Database name of the member - * database in the sync member. - * - * @param {string} [parameters.userName] User name of the member database in - * the sync member. - * - * @param {string} [parameters.password] Password of the member database in the - * sync member. + * Lists the long term retention backups for a given server. * - * @param {string} [parameters.syncDirection] Sync direction of the sync - * member. Possible values include: 'Bidirectional', 'OneWayMemberToHub', - * 'OneWayHubToMember' + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -14570,7 +17057,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMember} - The deserialized result object. + * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14578,20 +17065,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. + * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link LongTermRetentionBackupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, 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; + listByServerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServerNext(nextPageLink: string, callback: ServiceCallback): void; + listByServerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * BackupLongTermRetentionPolicies + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface BackupLongTermRetentionPolicies { /** - * Refreshes a sync member database schema. + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14599,13 +17096,7 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14614,14 +17105,14 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginRefreshMemberSchemaWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, syncGroupName: string, syncMemberName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Refreshes a sync member database schema. + * Gets a database's long term retention policy. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource @@ -14629,13 +17120,7 @@ export interface SyncMembers { * * @param {string} serverName The name of the server. * - * @param {string} databaseName The name of the database on which the sync - * group is hosted. - * - * @param {string} syncGroupName The name of the sync group on which the sync - * member is hosted. - * - * @param {string} syncMemberName The name of the sync member. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14649,7 +17134,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14657,22 +17142,43 @@ export interface SyncMembers { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. + * See {@link BackupLongTermRetentionPolicy} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * Lists sync members in the given sync group. + * Sets a database's long term retention policy. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * 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 {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -14681,17 +17187,36 @@ export interface SyncMembers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listBySyncGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists sync members in the given sync group. + * Sets a database's long term retention policy. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The long term retention policy info. + * + * @param {string} [parameters.weeklyRetention] The weekly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.monthlyRetention] The montly retention policy + * for an LTR backup in an ISO 8601 format. + * + * @param {string} [parameters.yearlyRetention] The yearly retention policy for + * an LTR backup in an ISO 8601 format. + * + * @param {number} [parameters.weekOfYear] The week of year to take the yearly + * backup in an ISO 8601 format. * * @param {object} [options] Optional Parameters. * @@ -14705,7 +17230,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncMemberListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14713,23 +17238,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. + * {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. */ - 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; + 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; /** - * Gets a sync member database schema. + * 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. * @@ -14738,17 +17269,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 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. * @@ -14762,7 +17298,7 @@ export interface SyncMembers { * * {Promise} A promise is returned. * - * @resolve {SyncFullSchemaPropertiesListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14770,33 +17306,43 @@ 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 + * {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. */ - listMemberSchemasNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMemberSchemasNext(nextPageLink: string, callback: ServiceCallback): void; - listMemberSchemasNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * SubscriptionUsages - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface SubscriptionUsages { + 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 all subscription usage metrics in a given location. + * Sets a database's long term retention policy. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} 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. * @@ -14805,17 +17351,36 @@ export interface SubscriptionUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subscription usage metrics in a given location. + * Sets a database's long term retention policy. * - * @param {string} locationName The name of the region where the resource is - * located. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {string} 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. * @@ -14829,7 +17394,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14837,26 +17402,41 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsageListResult} for more + * {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. */ - 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; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ManagedDatabases + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ManagedDatabases { /** - * Gets a subscription usage metric. + * Completes the restore operation on a managed database. * * @param {string} locationName The name of the region where the resource is * located. * - * @param {string} usageName Name of usage metric to return. + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -14865,19 +17445,25 @@ export interface SubscriptionUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(locationName: string, usageName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + completeRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a subscription usage metric. + * Completes the restore operation on a managed database. * * @param {string} locationName The name of the region where the resource is * located. * - * @param {string} usageName Name of usage metric to return. + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -14891,7 +17477,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsage} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14899,23 +17485,25 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsage} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsage} for more information. + * {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(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; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + completeRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets all subscription usage metrics in a given location. + * Gets a list of managed databases. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -14924,17 +17512,20 @@ export interface SubscriptionUsages { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByInstanceWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets all subscription usage metrics in a given location. + * Gets a list of managed databases. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. * * @param {object} [options] Optional Parameters. * @@ -14948,7 +17539,7 @@ export interface SubscriptionUsages { * * {Promise} A promise is returned. * - * @resolve {SubscriptionUsageListResult} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -14956,38 +17547,29 @@ export interface SubscriptionUsages { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {SubscriptionUsageListResult} [result] - The deserialized result object if an error did not occur. - * See {@link SubscriptionUsageListResult} for more + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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 { + listByInstance(resourceGroupName: string, managedInstanceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstance(resourceGroupName: string, managedInstanceName: string, callback: ServiceCallback): void; + listByInstance(resourceGroupName: string, managedInstanceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a virtual network rule. + * Gets a managed database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -14996,22 +17578,22 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a virtual network rule. + * Gets a managed database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15025,7 +17607,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15033,37 +17615,64 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an existing virtual network rule. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested virtual Network Rule Resource - * state. + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {object} [parameters.tags] Resource tags. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -15072,31 +17681,58 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, parameters: models.VirtualNetworkRule, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * - * @param {object} parameters The requested virtual Network Rule Resource - * state. + * @param {object} parameters The requested database resource state. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {string} [parameters.collation] Collation of the managed database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -15110,7 +17746,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRule} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15118,28 +17754,28 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VirtualNetworkRule} [result] - The deserialized result object if an error did not occur. - * See {@link VirtualNetworkRule} for more information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Deletes the managed database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15152,18 +17788,18 @@ 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, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Deletes the managed database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15191,19 +17827,55 @@ 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, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15212,20 +17884,56 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15239,7 +17947,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15247,38 +17955,31 @@ 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. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; - listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an existing virtual network rule. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Completes the restore operation on a managed database. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {object} parameters The requested virtual Network Rule Resource - * state. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {object} parameters The definition for completing the restore of this + * managed database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -15287,31 +17988,25 @@ 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>; + beginCompleteRestoreWithHttpOperationResponse(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an existing virtual network rule. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Completes the restore operation on a managed database. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {object} parameters The requested virtual Network Rule Resource - * state. + * @param {uuid} operationId Management operation id that this request tries to + * complete. * - * @param {string} parameters.virtualNetworkSubnetId The ARM resource id of the - * virtual network subnet. + * @param {object} parameters The definition for completing the restore of this + * managed database. * - * @param {boolean} [parameters.ignoreMissingVnetServiceEndpoint] Create - * firewall rule before the virtual network has vnet service endpoint enabled. + * @param {string} parameters.lastBackupName The last backup name to apply * * @param {object} [options] Optional Parameters. * @@ -15325,7 +18020,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. * @@ -15333,28 +18028,63 @@ 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; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, callback: ServiceCallback): void; + beginCompleteRestore(locationName: string, operationId: string, parameters: models.CompleteDatabaseRestoreDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the virtual network rule with the given name. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -15363,22 +18093,58 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, virtualNetworkRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the virtual network rule with the given name. + * Creates a new database or updates an existing database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} virtualNetworkRuleName The name of the virtual network rule. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. * * @param {object} [options] Optional Parameters. * @@ -15392,7 +18158,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15400,22 +18166,28 @@ export interface VirtualNetworkRules { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabase, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of virtual network rules in a server. + * Deletes the managed database. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15424,17 +18196,22 @@ export interface VirtualNetworkRules { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of virtual network rules in a server. + * Deletes the managed database. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -15448,7 +18225,7 @@ export interface VirtualNetworkRules { * * {Promise} A promise is returned. * - * @resolve {VirtualNetworkRuleListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15456,38 +18233,61 @@ 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. + * {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 - * LongTermRetentionBackups - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface LongTermRetentionBackups { + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedInstanceName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a long term retention backup. + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. * - * @param {string} locationName The location of the database. + * @param {object} parameters The requested database resource state. * - * @param {string} longTermRetentionServerName + * @param {string} [parameters.collation] Collation of the managed database. * - * @param {string} longTermRetentionDatabaseName + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. * - * @param {string} backupName The backup name. + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15496,22 +18296,56 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a long term retention backup. + * Updates an existing database. * - * @param {string} locationName The location of the database. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionServerName + * @param {string} managedInstanceName The name of the managed instance. * - * @param {string} longTermRetentionDatabaseName + * @param {string} databaseName The name of the database. * - * @param {string} backupName The backup name. + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -15525,7 +18359,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackup} - The deserialized result object. + * @resolve {ManagedDatabase} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15533,29 +18367,23 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackup} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackup} for more - * information. + * {ManagedDatabase} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(locationName: string, 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; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, managedInstanceName: string, databaseName: string, parameters: models.ManagedDatabaseUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a long term retention backup. + * Gets a list of managed databases. * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName - * - * @param {string} longTermRetentionDatabaseName - * - * @param {string} backupName The backup name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15564,22 +18392,17 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByInstanceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database - * - * @param {string} longTermRetentionServerName + * Gets a list of managed databases. * - * @param {string} longTermRetentionDatabaseName - * - * @param {string} backupName The backup name. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -15593,7 +18416,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ManagedDatabaseListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15601,64 +18424,61 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ManagedDatabaseListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listByInstanceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByInstanceNext(nextPageLink: string, callback: ServiceCallback): void; + listByInstanceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ServerAutomaticTuningOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ServerAutomaticTuningOperations { /** - * Lists all long term retention backups for a database. - * - * @param {string} locationName The location of the database + * Retrieves server automatic tuning options. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. - * - * @param {string} locationName The location of the database + * Retrieves server automatic tuning options. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. - * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -15669,7 +18489,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15677,57 +18497,64 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more - * 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. */ - 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; + 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; /** - * Lists the long term retention backups for a given location. + * Update automatic tuning options on server. * - * @param {string} locationName The location of the database + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {object} parameters The requested automatic tuning 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 {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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Update automatic tuning options on server. * - * @param {string} locationName The location of the database + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {object} parameters The requested automatic tuning 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 {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 @@ -15739,7 +18566,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerAutomaticTuning} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15747,61 +18574,65 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more - * information. + * {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. */ - 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; + 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 the long term retention backups for a given server. - * - * @param {string} locationName The location of the database + * Gets a server DNS alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. - * - * @param {string} locationName The location of the database + * Gets a server DNS alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {object} [options] Optional Parameters. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {boolean} [options.onlyLatestPerDatabase] Whether or not to only get - * the latest backup for each database. + * @param {string} dnsAliasName The name of the server DNS alias. * - * @param {string} [options.databaseState] Whether to query against just live - * databases, just deleted databases, or all databases. Possible values - * include: 'All', 'Live', 'Deleted' + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -15813,7 +18644,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15821,29 +18652,29 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more - * information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByServer(locationName: string, longTermRetentionServerName: string, options?: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByServer(locationName: string, longTermRetentionServerName: string, callback: ServiceCallback): void; - listByServer(locationName: string, longTermRetentionServerName: string, options: { onlyLatestPerDatabase? : boolean, databaseState? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15852,22 +18683,23 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(locationName: string, longTermRetentionServerName: string, longTermRetentionDatabaseName: string, backupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a long term retention backup. - * - * @param {string} locationName The location of the database + * Creates a server dns alias. * - * @param {string} longTermRetentionServerName + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. * - * @param {string} longTermRetentionDatabaseName + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} backupName The backup name. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15881,7 +18713,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15889,22 +18721,29 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(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; + 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; /** - * Lists all long term retention backups for a database. + * Deletes the server DNS alias with the given name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15913,17 +18752,23 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists all long term retention backups for a database. + * Deletes the server DNS alias with the given name. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -15937,7 +18782,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -15945,24 +18790,26 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the long term retention backups for a given location. + * Gets a list of server DNS aliases for a server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains 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. * @@ -15971,17 +18818,21 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given location. + * Gets a list of server DNS aliases for a server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains 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. * @@ -15995,7 +18846,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16003,24 +18854,35 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more + * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAliasListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByLocationNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByLocationNext(nextPageLink: string, callback: ServiceCallback): void; - listByLocationNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Lists the long term retention backups for a given server. + * Acquires server DNS alias from another server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -16029,17 +18891,28 @@ export interface LongTermRetentionBackups { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the long term retention backups for a given server. + * Acquires server DNS alias from another server. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server that the alias is pointing + * to. + * + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -16053,7 +18926,7 @@ export interface LongTermRetentionBackups { * * {Promise} A promise is returned. * - * @resolve {LongTermRetentionBackupListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16061,38 +18934,28 @@ export interface LongTermRetentionBackups { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LongTermRetentionBackupListResult} [result] - The deserialized result object if an error did not occur. - * See {@link LongTermRetentionBackupListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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 { + 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; /** - * Gets a database's long term retention policy. + * 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} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -16101,22 +18964,23 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's long term retention policy. + * 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} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -16130,7 +18994,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {ServerDnsAlias} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16138,43 +19002,29 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. + * See {@link ServerDnsAlias} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, serverName: string, 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; /** - * Sets a database's long term retention policy. + * Deletes the server DNS alias with the given name. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The long term retention policy info. - * - * @param {string} [parameters.weeklyRetention] The weekly retention policy for - * an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.monthlyRetention] The montly retention policy - * for an LTR backup in an ISO 8601 format. - * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} dnsAliasName The name of the server DNS alias. * * @param {object} [options] Optional Parameters. * @@ -16183,36 +19033,23 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The long term retention policy info. - * - * @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. + * Deletes the server DNS alias with the given name. * - * @param {string} [parameters.yearlyRetention] The yearly retention policy for - * an LTR backup in an ISO 8601 format. + * @param {string} resourceGroupName The 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.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @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. * @@ -16226,7 +19063,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16234,29 +19071,33 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(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; /** - * Gets a database's long term retention policy. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database. + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -16265,22 +19106,28 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a database's long term retention policy. + * Acquires server DNS alias from another server. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} serverName The name of the server that the alias is pointing + * to. * - * @param {string} databaseName The name of the database. + * @param {string} dnsAliasName The name of the server dns alias. + * + * @param {object} parameters + * + * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias + * that will be acquired to point to this server instead. * * @param {object} [options] Optional Parameters. * @@ -16294,7 +19141,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16302,43 +19149,22 @@ export interface BackupLongTermRetentionPolicies { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {BackupLongTermRetentionPolicy} [result] - The deserialized result object if an error did not occur. - * See {@link BackupLongTermRetentionPolicy} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; /** - * 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. + * Gets a list of server DNS aliases for a server. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16347,36 +19173,17 @@ export interface BackupLongTermRetentionPolicies { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.BackupLongTermRetentionPolicy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Sets a database's long term retention policy. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. - * - * @param {object} parameters The long term retention policy info. - * - * @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. + * Gets a list of server DNS aliases for a server. * - * @param {number} [parameters.weekOfYear] The week of year to take the yearly - * backup in an ISO 8601 format. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16390,7 +19197,7 @@ export interface BackupLongTermRetentionPolicies { * * {Promise} A promise is returned. * - * @resolve {BackupLongTermRetentionPolicy} - The deserialized result object. + * @resolve {ServerDnsAliasListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16398,30 +19205,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 + * {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, 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; + 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 - * ServerAutomaticTuningOperations + * RestorePoints * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface ServerAutomaticTuningOperations { +export interface RestorePoints { /** - * Retrieves server automatic tuning options. + * 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 @@ -16429,6 +19236,8 @@ export interface ServerAutomaticTuningOperations { * * @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 @@ -16436,14 +19245,14 @@ export interface ServerAutomaticTuningOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Retrieves server automatic tuning options. + * 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 @@ -16451,6 +19260,8 @@ export interface ServerAutomaticTuningOperations { * * @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 @@ -16463,7 +19274,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {RestorePointListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16471,20 +19282,21 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} for more information. + * {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. */ - 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; + 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; /** - * Update automatic tuning options on 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 @@ -16492,12 +19304,13 @@ export interface ServerAutomaticTuningOperations { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested automatic tuning resource state. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.desiredState] Automatic tuning desired state. - * Possible values include: 'Custom', 'Auto', 'Unspecified' + * @param {object} parameters The definition for creating the restore point of + * this database. * - * @param {object} [parameters.options] Automatic tuning options definition. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16506,14 +19319,14 @@ export interface ServerAutomaticTuningOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, serverName: string, parameters: models.ServerAutomaticTuning, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Update automatic tuning options on 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 @@ -16521,12 +19334,13 @@ export interface ServerAutomaticTuningOperations { * * @param {string} serverName The name of the server. * - * @param {object} parameters The requested automatic tuning resource state. + * @param {string} databaseName The name of the database. * - * @param {string} [parameters.desiredState] Automatic tuning desired state. - * Possible values include: 'Custom', 'Auto', 'Unspecified' + * @param {object} parameters The definition for creating the restore point of + * this database. * - * @param {object} [parameters.options] Automatic tuning options definition. + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16540,7 +19354,7 @@ export interface ServerAutomaticTuningOperations { * * {Promise} A promise is returned. * - * @resolve {ServerAutomaticTuning} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16548,38 +19362,30 @@ export interface ServerAutomaticTuningOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerAutomaticTuning} [result] - The deserialized result object if an error did not occur. - * See {@link ServerAutomaticTuning} for more information. + * {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. */ - 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 { + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a server DNS alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16588,23 +19394,24 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a server DNS alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16618,7 +19425,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16626,29 +19433,30 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {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, 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; + 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; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. + * + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16657,23 +19465,24 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a server dns alias. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} restorePointName The name of the restore point. * * @param {object} [options] Optional Parameters. * @@ -16687,7 +19496,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16695,29 +19504,33 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16726,23 +19539,28 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * 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 that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The definition for creating the restore point of + * this database. + * + * @param {string} parameters.restorePointLabel The restore point label to + * apply * * @param {object} [options] Optional Parameters. * @@ -16756,7 +19574,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {RestorePoint} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16764,26 +19582,39 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DatabaseOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface DatabaseOperations { /** - * Gets a list of server DNS aliases for a server. + * 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 * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -16792,21 +19623,24 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerWithHttpOperationResponse(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server DNS aliases for a server. + * 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 * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} serverName The name of the server. + * + * @param {string} databaseName The name of the database. + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -16820,7 +19654,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16828,35 +19662,27 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} for more - * information. + * {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; + 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; /** - * Acquires server DNS alias from another server. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * 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} serverName The name of the server. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16865,28 +19691,22 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - acquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another server. + * Gets a list of operations performed on the database. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * 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} serverName The name of the server. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} databaseName The name of the database. * * @param {object} [options] Optional Parameters. * @@ -16900,7 +19720,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16908,28 +19728,24 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; + listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a server dns alias. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * Gets a list of operations performed on the database. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16938,23 +19754,17 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByDatabaseNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * 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. + * Gets a list of operations performed on the database. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -16968,7 +19778,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAlias} - The deserialized result object. + * @resolve {DatabaseOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -16976,29 +19786,40 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAlias} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAlias} for more information. + * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link DatabaseOperationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; + listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ElasticPoolOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface ElasticPoolOperations { /** - * Deletes the server DNS alias with the given name. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -17011,19 +19832,20 @@ export interface ServerDnsAliases { * * @reject {Error|ServiceError} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the server DNS alias with the given name. + * Cancels the asynchronous operation on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. + * @param {string} serverName The name of the server. * - * @param {string} dnsAliasName The name of the server DNS alias. + * @param {string} elasticPoolName + * + * @param {uuid} operationId The operation identifier. * * @param {object} [options] Optional Parameters. * @@ -17051,27 +19873,21 @@ export interface ServerDnsAliases { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, callback: ServiceCallback): void; - beginDeleteMethod(resourceGroupName: string, serverName: string, dnsAliasName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** - * Acquires server DNS alias from another server. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server dns alias. - * - * @param {object} parameters + * @param {string} serverName The name of the server. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -17080,28 +19896,22 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginAcquireWithHttpOperationResponse(resourceGroupName: string, serverName: string, dnsAliasName: string, parameters: models.ServerDnsAliasAcquisition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Acquires server DNS alias from another server. + * Gets a list of operations performed on the elastic pool. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server that the alias is pointing - * to. - * - * @param {string} dnsAliasName The name of the server dns alias. - * - * @param {object} parameters + * @param {string} serverName The name of the server. * - * @param {string} [parameters.oldServerDnsAliasId] The id of the server alias - * that will be acquired to point to this server instead. + * @param {string} elasticPoolName * * @param {object} [options] Optional Parameters. * @@ -17115,7 +19925,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17123,19 +19933,21 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, callback: ServiceCallback): void; + listByElasticPool(resourceGroupName: string, serverName: string, elasticPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of server DNS aliases for a server. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -17147,14 +19959,14 @@ export interface ServerDnsAliases { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByServerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of server DNS aliases for a server. + * Gets a list of operations performed on the elastic pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -17171,7 +19983,7 @@ export interface ServerDnsAliases { * * {Promise} A promise is returned. * - * @resolve {ServerDnsAliasListResult} - The deserialized result object. + * @resolve {ElasticPoolOperationListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17179,65 +19991,65 @@ export interface ServerDnsAliases { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServerDnsAliasListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ServerDnsAliasListResult} for more + * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ElasticPoolOperationListResult} for more * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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 - * RestorePoints + * Capabilities * __NOTE__: An instance of this class is automatically created for an * instance of the SqlManagementClient. */ -export interface RestorePoints { +export interface Capabilities { /** - * 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. + * Gets the subscription capabilities available for the specified location. * - * @param {string} databaseName The name of the database. + * @param {string} locationName The location name whose capabilities are + * retrieved. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.include] If specified, restricts the response to + * only include the selected item. Possible values include: + * 'supportedEditions', 'supportedElasticPoolEditions', + * 'supportedManagedInstanceVersions' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of database restore points. - * - * @param {string} resourceGroupName The name of the resource group that - * contains the resource. You can obtain this value from the Azure Resource - * Manager API or the portal. - * - * @param {string} serverName The name of the server. + * Gets the subscription capabilities available for the specified location. * - * @param {string} databaseName The name of the database. + * @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 * @@ -17248,7 +20060,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePointListResult} - The deserialized result object. + * @resolve {LocationCapabilities} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17256,35 +20068,38 @@ 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. + * {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. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listByLocation(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(locationName: string, callback: ServiceCallback): void; + listByLocation(locationName: string, options: { include? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * InstanceFailoverGroups + * __NOTE__: An instance of this class is automatically created for an + * instance of the SqlManagementClient. + */ +export interface InstanceFailoverGroups { /** - * Creates a restore point for a data warehouse. + * 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} databaseName The name of the database. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17293,28 +20108,23 @@ export interface RestorePoints { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a restore point for a data warehouse. + * 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} databaseName The name of the database. - * - * @param {object} parameters The definition for creating the restore point of - * this database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} parameters.restorePointLabel The restore point label to - * apply + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17328,7 +20138,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17336,30 +20146,58 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, callback: ServiceCallback): void; - create(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a restore point. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} restorePointName The name of the restore point. + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17368,24 +20206,52 @@ export interface RestorePoints { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a restore point. + * Creates or updates a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * - * @param {string} restorePointName The name of the restore point. + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17399,7 +20265,7 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17407,30 +20273,29 @@ export interface RestorePoints { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestorePoint} [result] - The deserialized result object if an error did not occur. - * See {@link RestorePoint} for more information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a restore point. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} restorePointName The name of the restore point. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17443,20 +20308,19 @@ export interface RestorePoints { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a restore point. + * Deletes a failover group. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} restorePointName The name of the restore point. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17484,27 +20348,20 @@ export interface RestorePoints { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, serverName: string, databaseName: string, restorePointName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates a restore point for a data warehouse. + * Lists the failover groups in a location. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} 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 {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -17513,28 +20370,21 @@ export interface RestorePoints { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, parameters: models.CreateDatabaseRestorePointDefinition, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationWithHttpOperationResponse(resourceGroupName: string, locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates a restore point for a data warehouse. + * Lists the failover groups in a location. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} 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 {string} locationName The name of the region where the resource is + * located. * * @param {object} [options] Optional Parameters. * @@ -17548,47 +20398,39 @@ export interface RestorePoints { * * {Promise} A promise is returned. * - * @resolve {RestorePoint} - The deserialized result object. + * @resolve {InstanceFailoverGroupListResult} - 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. - * - * {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. - */ - 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 { + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {InstanceFailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(resourceGroupName: string, locationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByLocation(resourceGroupName: string, locationName: string, callback: ServiceCallback): void; + listByLocation(resourceGroupName: string, locationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels the asynchronous operation on the database. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17597,24 +20439,24 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + failoverWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the database. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. - * - * @param {string} databaseName The name of the database. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17628,7 +20470,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17636,27 +20478,30 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, serverName: string, databaseName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + failover(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17665,22 +20510,24 @@ export interface DatabaseOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByDatabaseWithHttpOperationResponse(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} databaseName The name of the database. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17694,7 +20541,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17702,24 +20549,58 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more - * information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, callback: ServiceCallback): void; - listByDatabase(resourceGroupName: string, serverName: string, databaseName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + forceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the database. + * Creates or updates a failover 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} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17728,17 +20609,52 @@ 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>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the database. + * Creates or updates a failover 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} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. * * @param {object} [options] Optional Parameters. * @@ -17752,7 +20668,7 @@ export interface DatabaseOperations { * * {Promise} A promise is returned. * - * @resolve {DatabaseOperationListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17760,40 +20676,29 @@ export interface DatabaseOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {DatabaseOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link DatabaseOperationListResult} for more - * information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listByDatabaseNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDatabaseNext(nextPageLink: string, callback: ServiceCallback): void; - listByDatabaseNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ElasticPoolOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the SqlManagementClient. - */ -export interface ElasticPoolOperations { + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, locationName: string, failoverGroupName: string, parameters: models.InstanceFailoverGroup, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Cancels the asynchronous operation on the elastic pool. + * 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} elasticPoolName + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17806,20 +20711,19 @@ export interface ElasticPoolOperations { * * @reject {Error|ServiceError} - The error object. */ - cancelWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Cancels the asynchronous operation on the elastic pool. + * 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} elasticPoolName + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {uuid} operationId The operation identifier. + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17847,21 +20751,23 @@ export interface ElasticPoolOperations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, callback: ServiceCallback): void; - cancel(resourceGroupName: string, serverName: string, elasticPoolName: string, operationId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the elastic pool. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} elasticPoolName + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17870,22 +20776,24 @@ export interface ElasticPoolOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolWithHttpOperationResponse(resourceGroupName: string, serverName: string, elasticPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginFailoverWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * Fails over from the current primary managed instance to this managed + * instance. * * @param {string} resourceGroupName The name of the resource group that * contains the resource. You can obtain this value from the Azure Resource * Manager API or the portal. * - * @param {string} serverName The name of the server. + * @param {string} locationName The name of the region where the resource is + * located. * - * @param {string} elasticPoolName + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17899,7 +20807,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17907,24 +20815,30 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} for more - * information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginFailover(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets a list of operations performed on the elastic pool. + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17933,17 +20847,24 @@ export interface ElasticPoolOperations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByElasticPoolNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets a list of operations performed on the elastic pool. + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. * * @param {object} [options] Optional Parameters. * @@ -17957,7 +20878,7 @@ export interface ElasticPoolOperations { * * {Promise} A promise is returned. * - * @resolve {ElasticPoolOperationListResult} - The deserialized result object. + * @resolve {InstanceFailoverGroup} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -17965,65 +20886,45 @@ export interface ElasticPoolOperations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ElasticPoolOperationListResult} [result] - The deserialized result object if an error did not occur. - * See {@link ElasticPoolOperationListResult} for more - * information. + * {InstanceFailoverGroup} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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 { + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, callback: ServiceCallback): void; + beginForceFailoverAllowDataLoss(resourceGroupName: string, locationName: string, failoverGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Gets the subscription capabilities available for the specified location. + * Lists the failover groups in a location. * - * @param {string} locationName The location name whose capabilities are - * retrieved. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.include] If specified, restricts the response to - * only include the selected item. Possible values include: - * 'supportedEditions', 'supportedElasticPoolEditions', - * 'supportedManagedInstanceVersions' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listByLocationWithHttpOperationResponse(locationName: string, options?: { include? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listByLocationNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Gets the subscription capabilities available for the specified location. + * Lists the failover groups in a location. * - * @param {string} locationName The location name whose capabilities are - * retrieved. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @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 * @@ -18034,7 +20935,7 @@ export interface Capabilities { * * {Promise} A promise is returned. * - * @resolve {LocationCapabilities} - The deserialized result object. + * @resolve {InstanceFailoverGroupListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -18042,14 +20943,15 @@ export interface Capabilities { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {LocationCapabilities} [result] - The deserialized result object if an error did not occur. - * See {@link LocationCapabilities} for more information. + * {InstanceFailoverGroupListResult} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. * * {WebResource} [request] - The HTTP Request object if an error did not occur. * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - 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; + 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; } diff --git a/lib/services/sqlManagement2/lib/operations/index.js b/lib/services/sqlManagement2/lib/operations/index.js index 56d738959a..c8f3d9bcdd 100644 --- a/lib/services/sqlManagement2/lib/operations/index.js +++ b/lib/services/sqlManagement2/lib/operations/index.js @@ -41,6 +41,7 @@ exports.DatabaseBlobAuditingPolicies = require('./databaseBlobAuditingPolicies') exports.DatabaseAutomaticTuningOperations = require('./databaseAutomaticTuningOperations'); exports.EncryptionProtectors = require('./encryptionProtectors'); exports.FailoverGroups = require('./failoverGroups'); +exports.ManagedInstances = require('./managedInstances'); exports.Operations = require('./operations'); exports.ServerKeys = require('./serverKeys'); exports.SyncAgents = require('./syncAgents'); @@ -50,9 +51,11 @@ exports.SubscriptionUsages = require('./subscriptionUsages'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); exports.LongTermRetentionBackups = require('./longTermRetentionBackups'); exports.BackupLongTermRetentionPolicies = require('./backupLongTermRetentionPolicies'); +exports.ManagedDatabases = require('./managedDatabases'); exports.ServerAutomaticTuningOperations = require('./serverAutomaticTuningOperations'); exports.ServerDnsAliases = require('./serverDnsAliases'); exports.RestorePoints = require('./restorePoints'); exports.DatabaseOperations = require('./databaseOperations'); exports.ElasticPoolOperations = require('./elasticPoolOperations'); exports.Capabilities = require('./capabilities'); +exports.InstanceFailoverGroups = require('./instanceFailoverGroups'); diff --git a/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js b/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js new file mode 100644 index 0000000000..963a57ef7e --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/instanceFailoverGroups.js @@ -0,0 +1,2634 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Lists the failover groups in a location. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocation(resourceGroupName, locationName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _failover(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginFailover(resourceGroupName, locationName, failoverGroupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['InstanceFailoverGroup']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginFailover(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-10-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (failoverGroupName === null || failoverGroupName === undefined || typeof failoverGroupName.valueOf() !== 'string') { + throw new Error('failoverGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{failoverGroupName}', encodeURIComponent(failoverGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroup']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the failover groups in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByLocationNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['InstanceFailoverGroupListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a InstanceFailoverGroups. */ +class InstanceFailoverGroups { + /** + * Create a InstanceFailoverGroups. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._listByLocation = _listByLocation; + this._failover = _failover; + this._forceFailoverAllowDataLoss = _forceFailoverAllowDataLoss; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginFailover = _beginFailover; + this._beginForceFailoverAllowDataLoss = _beginForceFailoverAllowDataLoss; + this._listByLocationNext = _listByLocationNext; + } + + /** + * Gets a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Lists the failover groups in a location. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationWithHttpOperationResponse(resourceGroupName, locationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocation(resourceGroupName, locationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the failover groups in a location. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocation(resourceGroupName, locationName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocation(resourceGroupName, locationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocation(resourceGroupName, locationName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + failoverWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._failover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + failover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._failover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._failover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + forceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._forceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} parameters The failover group parameters. + * + * @param {object} parameters.readWriteEndpoint Read-write endpoint of the + * failover group instance. + * + * @param {string} parameters.readWriteEndpoint.failoverPolicy Failover policy + * of the read-write endpoint for the failover group. If failoverPolicy is + * Automatic then failoverWithDataLossGracePeriodMinutes is required. Possible + * values include: 'Manual', 'Automatic' + * + * @param {number} + * [parameters.readWriteEndpoint.failoverWithDataLossGracePeriodMinutes] Grace + * period before failover with data loss is attempted for the read-write + * endpoint. If failoverPolicy is Automatic then + * failoverWithDataLossGracePeriodMinutes is required. + * + * @param {object} [parameters.readOnlyEndpoint] Read-only endpoint of the + * failover group instance. + * + * @param {string} [parameters.readOnlyEndpoint.failoverPolicy] Failover policy + * of the read-only endpoint for the failover group. Possible values include: + * 'Disabled', 'Enabled' + * + * @param {array} parameters.partnerRegions Partner region information for the + * failover group. + * + * @param {array} parameters.managedInstancePairs List of managed instance + * pairs in the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, locationName, failoverGroupName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a failover group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginFailoverWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginFailover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginFailover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginFailover(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginFailover(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginForceFailoverAllowDataLossWithHttpOperationResponse(resourceGroupName, locationName, failoverGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Fails over from the current primary managed instance to this managed + * instance. This operation might result in data loss. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {string} failoverGroupName The name of the failover group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroup} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroup} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginForceFailoverAllowDataLoss(resourceGroupName, locationName, failoverGroupName, options, optionalCallback); + } + } + + /** + * Lists the failover groups in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByLocationNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists the failover groups in a location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {InstanceFailoverGroupListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link InstanceFailoverGroupListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByLocationNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByLocationNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByLocationNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = InstanceFailoverGroups; diff --git a/lib/services/sqlManagement2/lib/operations/managedDatabases.js b/lib/services/sqlManagement2/lib/operations/managedDatabases.js new file mode 100644 index 0000000000..4f1c1c5fe0 --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/managedDatabases.js @@ -0,0 +1,2851 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + + +/** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _completeRestore(locationName, operationId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCompleteRestore(locationName, operationId, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Gets a list of managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByInstance(resourceGroupName, managedInstanceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, managedInstanceName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, managedInstanceName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCompleteRestore(locationName, operationId, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (locationName === null || locationName === undefined || typeof locationName.valueOf() !== 'string') { + throw new Error('locationName cannot be null or undefined and it must be of type string.'); + } + if (operationId === null || operationId === undefined || typeof operationId.valueOf() !== 'string' || !msRest.isValidUuid(operationId)) { + throw new Error('operationId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseRestoreAzureAsyncOperation/{operationId}/completeRestore'; + requestUrl = requestUrl.replace('{locationName}', encodeURIComponent(locationName)); + requestUrl = requestUrl.replace('{operationId}', encodeURIComponent(operationId.toString())); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['CompleteDatabaseRestoreDefinition']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedDatabase']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-03-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (databaseName === null || databaseName === undefined || typeof databaseName.valueOf() !== 'string') { + throw new Error('databaseName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{databaseName}', encodeURIComponent(databaseName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedDatabaseUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabase']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of managed databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByInstanceNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedDatabaseListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ManagedDatabases. */ +class ManagedDatabases { + /** + * Create a ManagedDatabases. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._completeRestore = _completeRestore; + this._listByInstance = _listByInstance; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCompleteRestore = _beginCompleteRestore; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listByInstanceNext = _listByInstanceNext; + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + completeRestoreWithHttpOperationResponse(locationName, operationId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._completeRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + completeRestore(locationName, operationId, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._completeRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._completeRestore(locationName, operationId, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByInstanceWithHttpOperationResponse(resourceGroupName, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByInstance(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of managed databases. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabaseListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByInstance(resourceGroupName, managedInstanceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByInstance(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByInstance(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Gets a managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabase} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback); + } + } + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabase} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback); + } + } + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabase} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCompleteRestoreWithHttpOperationResponse(locationName, operationId, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCompleteRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Completes the restore operation on a managed database. + * + * @param {string} locationName The name of the region where the resource is + * located. + * + * @param {uuid} operationId Management operation id that this request tries to + * complete. + * + * @param {object} parameters The definition for completing the restore of this + * managed database. + * + * @param {string} parameters.lastBackupName The last backup name to apply + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCompleteRestore(locationName, operationId, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCompleteRestore(locationName, operationId, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCompleteRestore(locationName, operationId, parameters, options, optionalCallback); + } + } + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates a new database or updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabase} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the managed database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, managedInstanceName, databaseName, options, optionalCallback); + } + } + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, databaseName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates an existing database. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {string} databaseName The name of the database. + * + * @param {object} parameters The requested database resource state. + * + * @param {string} [parameters.collation] Collation of the managed database. + * + * @param {date} [parameters.restorePointInTime] Conditional. If createMode is + * PointInTimeRestore, this value is required. Specifies the point in time + * (ISO8601 format) of the source database that will be restored to create the + * new database. + * + * @param {string} [parameters.catalogCollation] Collation of the metadata + * catalog. Possible values include: 'DATABASE_DEFAULT', + * 'SQL_Latin1_General_CP1_CI_AS' + * + * @param {string} [parameters.createMode] Managed database create mode. + * PointInTimeRestore: Create a database by restoring a point in time backup of + * an existing database. SourceDatabaseName, SourceManagedInstanceName and + * PointInTime must be specified. RestoreExternalBackup: Create a database by + * restoring from external backup files. Collation, StorageContainerUri and + * StorageContainerSasToken must be specified. Possible values include: + * 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + * + * @param {string} [parameters.storageContainerUri] Conditional. If createMode + * is RestoreExternalBackup, this value is required. Specifies the uri of the + * storage container where backups for this restore are stored. + * + * @param {string} [parameters.sourceDatabaseId] The resource identifier of the + * source database associated with create operation of this database. + * + * @param {string} [parameters.storageContainerSasToken] Conditional. If + * createMode is RestoreExternalBackup, this value is required. Specifies the + * storage container sas token. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabase} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabase} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, managedInstanceName, databaseName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of managed databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByInstanceNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByInstanceNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of managed databases. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedDatabaseListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedDatabaseListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByInstanceNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByInstanceNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByInstanceNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ManagedDatabases; diff --git a/lib/services/sqlManagement2/lib/operations/managedInstances.js b/lib/services/sqlManagement2/lib/operations/managedInstances.js new file mode 100644 index 0000000000..97150b9f7a --- /dev/null +++ b/lib/services/sqlManagement2/lib/operations/managedInstances.js @@ -0,0 +1,2862 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Gets a list of all managed instances in the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstanceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of managed instances in a resource group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstanceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, managedInstanceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, managedInstanceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, managedInstanceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedInstance']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, managedInstanceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginUpdate(resourceGroupName, managedInstanceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2015-05-01-preview'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (managedInstanceName === null || managedInstanceName === undefined || typeof managedInstanceName.valueOf() !== 'string') { + throw new Error('managedInstanceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedInstanceName}', encodeURIComponent(managedInstanceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedInstanceUpdate']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstance']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of all managed instances in the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstanceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Gets a list of managed instances in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedInstanceListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a ManagedInstances. */ +class ManagedInstances { + /** + * Create a ManagedInstances. + * @param {SqlManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginUpdate = _beginUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstanceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstanceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, managedInstanceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.identity] The Azure Active Directory identity of + * the managed instance. + * + * @param {string} [parameters.identity.type] The identity type. Set this to + * 'SystemAssigned' in order to automatically create and assign an Azure Active + * Directory principal for the resource. Possible values include: + * 'SystemAssigned' + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {string} parameters.location Resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, managedInstanceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedInstanceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, managedInstanceName, options, optionalCallback); + } + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, managedInstanceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a managed instance. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} managedInstanceName The name of the managed instance. + * + * @param {object} parameters The requested managed instance resource state. + * + * @param {object} [parameters.sku] Managed instance sku + * + * @param {string} parameters.sku.name The name of the SKU, typically, a letter + * + Number code, e.g. P3. + * + * @param {string} [parameters.sku.tier] The tier of the particular SKU, e.g. + * Basic, Premium. + * + * @param {string} [parameters.sku.size] Size of the particular SKU + * + * @param {string} [parameters.sku.family] If the service has different + * generations of hardware, for the same SKU, then that can be captured here. + * + * @param {number} [parameters.sku.capacity] Capacity of the particular SKU. + * + * @param {string} [parameters.administratorLogin] Administrator username for + * the managed instance. Can only be specified when the managed instance is + * being created (and is required for creation). + * + * @param {string} [parameters.administratorLoginPassword] The administrator + * login password (required for managed instance creation). + * + * @param {string} [parameters.subnetId] Subnet resource ID for the managed + * instance. + * + * @param {string} [parameters.licenseType] The license type. Possible values + * are 'LicenseIncluded' and 'BasePrice'. + * + * @param {number} [parameters.vCores] The number of VCores. + * + * @param {number} [parameters.storageSizeInGB] The maximum storage size in GB. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstance} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstance} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, managedInstanceName, parameters, options, optionalCallback); + } + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstanceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedInstanceListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedInstanceListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ManagedInstances; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts index 951e647e01..4877fafd88 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.d.ts @@ -81,6 +81,7 @@ export default class SqlManagementClient extends AzureServiceClient { databaseAutomaticTuningOperations: operations.DatabaseAutomaticTuningOperations; encryptionProtectors: operations.EncryptionProtectors; failoverGroups: operations.FailoverGroups; + managedInstances: operations.ManagedInstances; operations: operations.Operations; serverKeys: operations.ServerKeys; syncAgents: operations.SyncAgents; @@ -90,12 +91,14 @@ export default class SqlManagementClient extends AzureServiceClient { virtualNetworkRules: operations.VirtualNetworkRules; longTermRetentionBackups: operations.LongTermRetentionBackups; backupLongTermRetentionPolicies: operations.BackupLongTermRetentionPolicies; + managedDatabases: operations.ManagedDatabases; serverAutomaticTuningOperations: operations.ServerAutomaticTuningOperations; serverDnsAliases: operations.ServerDnsAliases; restorePoints: operations.RestorePoints; databaseOperations: operations.DatabaseOperations; elasticPoolOperations: operations.ElasticPoolOperations; capabilities: operations.Capabilities; + instanceFailoverGroups: operations.InstanceFailoverGroups; } export { SqlManagementClient, models as SqlManagementModels }; diff --git a/lib/services/sqlManagement2/lib/sqlManagementClient.js b/lib/services/sqlManagement2/lib/sqlManagementClient.js index 4c2f9a8ebd..76cf74c0a5 100644 --- a/lib/services/sqlManagement2/lib/sqlManagementClient.js +++ b/lib/services/sqlManagement2/lib/sqlManagementClient.js @@ -98,6 +98,7 @@ class SqlManagementClient extends ServiceClient { this.databaseAutomaticTuningOperations = new operations.DatabaseAutomaticTuningOperations(this); this.encryptionProtectors = new operations.EncryptionProtectors(this); this.failoverGroups = new operations.FailoverGroups(this); + this.managedInstances = new operations.ManagedInstances(this); this.operations = new operations.Operations(this); this.serverKeys = new operations.ServerKeys(this); this.syncAgents = new operations.SyncAgents(this); @@ -107,12 +108,14 @@ class SqlManagementClient extends ServiceClient { this.virtualNetworkRules = new operations.VirtualNetworkRules(this); this.longTermRetentionBackups = new operations.LongTermRetentionBackups(this); this.backupLongTermRetentionPolicies = new operations.BackupLongTermRetentionPolicies(this); + this.managedDatabases = new operations.ManagedDatabases(this); this.serverAutomaticTuningOperations = new operations.ServerAutomaticTuningOperations(this); this.serverDnsAliases = new operations.ServerDnsAliases(this); this.restorePoints = new operations.RestorePoints(this); this.databaseOperations = new operations.DatabaseOperations(this); this.elasticPoolOperations = new operations.ElasticPoolOperations(this); this.capabilities = new operations.Capabilities(this); + this.instanceFailoverGroups = new operations.InstanceFailoverGroups(this); this.models = models; msRest.addSerializationMixin(this); }