From 3da75e31b4a2fc47ed03f1375b2971aec24471ea Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sun, 2 Dec 2018 20:30:53 +0000 Subject: [PATCH] Generated from 360d32ab4a5ddd5fbbc1f1f979d403217e6fdbce typo: mysql/resource-manager/Microsoft.DBforMySQL - allowd -> allowed - relica -> replica - Trim trailing spaces --- .../mysqlManagement/lib/models/index.d.ts | 23 +- .../mysqlManagement/lib/models/index.js | 4 +- .../mysqlManagement/lib/models/server.js | 29 ++ .../lib/models/serverPropertiesForReplica.js | 93 ++++++ .../lib/models/serverUpdateParameters.js | 10 +- .../lib/mySQLManagementClient.d.ts | 1 + .../lib/mySQLManagementClient.js | 1 + .../mysqlManagement/lib/operations/index.d.ts | 84 ++++++ .../mysqlManagement/lib/operations/index.js | 1 + .../lib/operations/replicas.js | 267 ++++++++++++++++++ .../mysqlManagement/lib/operations/servers.js | 18 ++ lib/services/mysqlManagement/package.json | 2 +- 12 files changed, 529 insertions(+), 4 deletions(-) create mode 100644 lib/services/mysqlManagement/lib/models/serverPropertiesForReplica.js create mode 100644 lib/services/mysqlManagement/lib/operations/replicas.js diff --git a/lib/services/mysqlManagement/lib/models/index.d.ts b/lib/services/mysqlManagement/lib/models/index.d.ts index 2478ef2dc5..1df6908348 100755 --- a/lib/services/mysqlManagement/lib/models/index.d.ts +++ b/lib/services/mysqlManagement/lib/models/index.d.ts @@ -135,6 +135,18 @@ export interface ServerPropertiesForGeoRestore extends ServerPropertiesForCreate sourceServerId: string; } +/** + * @class + * Initializes a new instance of the ServerPropertiesForReplica class. + * @constructor + * The properties to create a new replica. + * + * @member {string} sourceServerId The master server id to create replica from. + */ +export interface ServerPropertiesForReplica extends ServerPropertiesForCreate { + sourceServerId: string; +} + /** * @class * Initializes a new instance of the Sku class. @@ -195,6 +207,10 @@ export interface Sku { * not for server backup. Possible values include: 'Enabled', 'Disabled' * @member {number} [storageProfile.storageMB] Max storage allowed for a * server. + * @member {string} [replicationRole] The replication role of the server. + * @member {string} [masterServerId] The master server id of a replica server. + * @member {number} [replicaCapacity] The maximum number of replicas that a + * master server can have. */ export interface Server extends TrackedResource { sku?: Sku; @@ -205,6 +221,9 @@ export interface Server extends TrackedResource { fullyQualifiedDomainName?: string; earliestRestoreDate?: Date; storageProfile?: StorageProfile; + replicationRole?: string; + masterServerId?: string; + replicaCapacity?: number; } /** @@ -252,7 +271,7 @@ export interface ServerForCreate { * @class * Initializes a new instance of the ServerUpdateParameters class. * @constructor - * Parameters allowd to update for a server. + * Parameters allowed to update for a server. * * @member {object} [sku] The SKU (pricing tier) of the server. * @member {string} [sku.name] The name of the sku, typically, tier + family + @@ -277,6 +296,7 @@ export interface ServerForCreate { * '5.6', '5.7' * @member {string} [sslEnforcement] Enable ssl enforcement or not when connect * to server. Possible values include: 'Enabled', 'Disabled' + * @member {string} [replicationRole] The replication role of the server. * @member {object} [tags] Application-specific metadata in the form of * key-value pairs. */ @@ -286,6 +306,7 @@ export interface ServerUpdateParameters { administratorLoginPassword?: string; version?: string; sslEnforcement?: string; + replicationRole?: string; tags?: { [propertyName: string]: string }; } diff --git a/lib/services/mysqlManagement/lib/models/index.js b/lib/services/mysqlManagement/lib/models/index.js index bde5b92b6c..d9d86b3131 100755 --- a/lib/services/mysqlManagement/lib/models/index.js +++ b/lib/services/mysqlManagement/lib/models/index.js @@ -25,6 +25,7 @@ exports.ServerPropertiesForCreate = require('./serverPropertiesForCreate'); exports.ServerPropertiesForDefaultCreate = require('./serverPropertiesForDefaultCreate'); exports.ServerPropertiesForRestore = require('./serverPropertiesForRestore'); exports.ServerPropertiesForGeoRestore = require('./serverPropertiesForGeoRestore'); +exports.ServerPropertiesForReplica = require('./serverPropertiesForReplica'); exports.Sku = require('./sku'); exports.Server = require('./server'); exports.ServerForCreate = require('./serverForCreate'); @@ -53,5 +54,6 @@ exports.discriminators = { 'ServerPropertiesForCreate' : exports.ServerPropertiesForCreate, 'ServerPropertiesForCreate.Default' : exports.ServerPropertiesForDefaultCreate, 'ServerPropertiesForCreate.PointInTimeRestore' : exports.ServerPropertiesForRestore, - 'ServerPropertiesForCreate.GeoRestore' : exports.ServerPropertiesForGeoRestore + 'ServerPropertiesForCreate.GeoRestore' : exports.ServerPropertiesForGeoRestore, + 'ServerPropertiesForCreate.Replica' : exports.ServerPropertiesForReplica }; diff --git a/lib/services/mysqlManagement/lib/models/server.js b/lib/services/mysqlManagement/lib/models/server.js index fed96ac529..4b0a303555 100755 --- a/lib/services/mysqlManagement/lib/models/server.js +++ b/lib/services/mysqlManagement/lib/models/server.js @@ -50,6 +50,11 @@ class Server extends models['TrackedResource'] { * or not for server backup. Possible values include: 'Enabled', 'Disabled' * @member {number} [storageProfile.storageMB] Max storage allowed for a * server. + * @member {string} [replicationRole] The replication role of the server. + * @member {string} [masterServerId] The master server id of a replica + * server. + * @member {number} [replicaCapacity] The maximum number of replicas that a + * master server can have. */ constructor() { super(); @@ -172,6 +177,30 @@ class Server extends models['TrackedResource'] { name: 'Composite', className: 'StorageProfile' } + }, + replicationRole: { + required: false, + serializedName: 'properties.replicationRole', + type: { + name: 'String' + } + }, + masterServerId: { + required: false, + serializedName: 'properties.masterServerId', + type: { + name: 'String' + } + }, + replicaCapacity: { + required: false, + serializedName: 'properties.replicaCapacity', + constraints: { + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/mysqlManagement/lib/models/serverPropertiesForReplica.js b/lib/services/mysqlManagement/lib/models/serverPropertiesForReplica.js new file mode 100644 index 0000000000..fcd68bb9db --- /dev/null +++ b/lib/services/mysqlManagement/lib/models/serverPropertiesForReplica.js @@ -0,0 +1,93 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The properties to create a new replica. + * + * @extends models['ServerPropertiesForCreate'] + */ +class ServerPropertiesForReplica extends models['ServerPropertiesForCreate'] { + /** + * Create a ServerPropertiesForReplica. + * @member {string} sourceServerId The master server id to create replica + * from. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServerPropertiesForReplica + * + * @returns {object} metadata of ServerPropertiesForReplica + * + */ + mapper() { + return { + required: false, + serializedName: 'Replica', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'createMode', + clientName: 'createMode' + }, + uberParent: 'ServerPropertiesForCreate', + className: 'ServerPropertiesForReplica', + modelProperties: { + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + }, + sslEnforcement: { + required: false, + serializedName: 'sslEnforcement', + type: { + name: 'Enum', + allowedValues: [ 'Enabled', 'Disabled' ] + } + }, + storageProfile: { + required: false, + serializedName: 'storageProfile', + type: { + name: 'Composite', + className: 'StorageProfile' + } + }, + createMode: { + required: true, + serializedName: 'createMode', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + sourceServerId: { + required: true, + serializedName: 'sourceServerId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerPropertiesForReplica; diff --git a/lib/services/mysqlManagement/lib/models/serverUpdateParameters.js b/lib/services/mysqlManagement/lib/models/serverUpdateParameters.js index fa3dfdd2c4..ebeee95e59 100755 --- a/lib/services/mysqlManagement/lib/models/serverUpdateParameters.js +++ b/lib/services/mysqlManagement/lib/models/serverUpdateParameters.js @@ -11,7 +11,7 @@ 'use strict'; /** - * Parameters allowd to update for a server. + * Parameters allowed to update for a server. * */ class ServerUpdateParameters { @@ -40,6 +40,7 @@ class ServerUpdateParameters { * include: '5.6', '5.7' * @member {string} [sslEnforcement] Enable ssl enforcement or not when * connect to server. Possible values include: 'Enabled', 'Disabled' + * @member {string} [replicationRole] The replication role of the server. * @member {object} [tags] Application-specific metadata in the form of * key-value pairs. */ @@ -98,6 +99,13 @@ class ServerUpdateParameters { allowedValues: [ 'Enabled', 'Disabled' ] } }, + replicationRole: { + required: false, + serializedName: 'properties.replicationRole', + type: { + name: 'String' + } + }, tags: { required: false, serializedName: 'tags', diff --git a/lib/services/mysqlManagement/lib/mySQLManagementClient.d.ts b/lib/services/mysqlManagement/lib/mySQLManagementClient.d.ts index 1d350de821..e3704438ad 100755 --- a/lib/services/mysqlManagement/lib/mySQLManagementClient.d.ts +++ b/lib/services/mysqlManagement/lib/mySQLManagementClient.d.ts @@ -57,6 +57,7 @@ export default class MySQLManagementClient extends AzureServiceClient { // Operation groups servers: operations.Servers; + replicas: operations.Replicas; firewallRules: operations.FirewallRules; virtualNetworkRules: operations.VirtualNetworkRules; databases: operations.Databases; diff --git a/lib/services/mysqlManagement/lib/mySQLManagementClient.js b/lib/services/mysqlManagement/lib/mySQLManagementClient.js index 928f9296ad..1880ddb158 100755 --- a/lib/services/mysqlManagement/lib/mySQLManagementClient.js +++ b/lib/services/mysqlManagement/lib/mySQLManagementClient.js @@ -73,6 +73,7 @@ class MySQLManagementClient extends ServiceClient { this.generateClientRequestId = options.generateClientRequestId; } this.servers = new operations.Servers(this); + this.replicas = new operations.Replicas(this); this.firewallRules = new operations.FirewallRules(this); this.virtualNetworkRules = new operations.VirtualNetworkRules(this); this.databases = new operations.Databases(this); diff --git a/lib/services/mysqlManagement/lib/operations/index.d.ts b/lib/services/mysqlManagement/lib/operations/index.d.ts index 234d9c2722..03a1359323 100755 --- a/lib/services/mysqlManagement/lib/operations/index.d.ts +++ b/lib/services/mysqlManagement/lib/operations/index.d.ts @@ -231,6 +231,9 @@ export interface Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -296,6 +299,9 @@ export interface Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -776,6 +782,9 @@ export interface Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -841,6 +850,9 @@ export interface Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -938,6 +950,78 @@ export interface Servers { beginDeleteMethod(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * Replicas + * __NOTE__: An instance of this class is automatically created for an + * instance of the MySQLManagementClient. + */ +export interface Replicas { + + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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>; + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {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 {ServerListResult} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ServerListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ServerListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName: string, serverName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByServer(resourceGroupName: string, serverName: string, callback: ServiceCallback): void; + listByServer(resourceGroupName: string, serverName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * FirewallRules diff --git a/lib/services/mysqlManagement/lib/operations/index.js b/lib/services/mysqlManagement/lib/operations/index.js index 21ca13c36c..92ef405ca4 100755 --- a/lib/services/mysqlManagement/lib/operations/index.js +++ b/lib/services/mysqlManagement/lib/operations/index.js @@ -15,6 +15,7 @@ 'use strict'; exports.Servers = require('./servers'); +exports.Replicas = require('./replicas'); exports.FirewallRules = require('./firewallRules'); exports.VirtualNetworkRules = require('./virtualNetworkRules'); exports.Databases = require('./databases'); diff --git a/lib/services/mysqlManagement/lib/operations/replicas.js b/lib/services/mysqlManagement/lib/operations/replicas.js new file mode 100644 index 0000000000..ebbc2c60e4 --- /dev/null +++ b/lib/services/mysqlManagement/lib/operations/replicas.js @@ -0,0 +1,267 @@ +/* + * 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; + +/** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {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 ServerListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByServer(resourceGroupName, serverName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion 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 (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') { + throw new Error('serverName cannot be null or undefined and it must be of type string.'); + } + if (this.client.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.DBforMySQL/servers/{serverName}/replicas'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.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['ServerListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let 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 Replicas. */ +class Replicas { + /** + * Create a Replicas. + * @param {MySQLManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listByServer = _listByServer; + } + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByServerWithHttpOperationResponse(resourceGroupName, serverName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * List all the replicas for a given server. + * + * @param {string} resourceGroupName The name of the resource group that + * contains the resource. You can obtain this value from the Azure Resource + * Manager API or the portal. + * + * @param {string} serverName The name of the server. + * + * @param {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 {ServerListResult} - 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 ServerListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByServer(resourceGroupName, serverName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByServer(resourceGroupName, serverName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByServer(resourceGroupName, serverName, options, optionalCallback); + } + } + +} + +module.exports = Replicas; diff --git a/lib/services/mysqlManagement/lib/operations/servers.js b/lib/services/mysqlManagement/lib/operations/servers.js index 7ca6c04909..cead22ec5d 100755 --- a/lib/services/mysqlManagement/lib/operations/servers.js +++ b/lib/services/mysqlManagement/lib/operations/servers.js @@ -193,6 +193,9 @@ function _create(resourceGroupName, serverName, parameters, options, callback) { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -1031,6 +1034,9 @@ function _beginCreate(resourceGroupName, serverName, parameters, options, callba * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -1574,6 +1580,9 @@ class Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -1651,6 +1660,9 @@ class Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -2281,6 +2293,9 @@ class Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * @@ -2358,6 +2373,9 @@ class Servers { * @param {string} [parameters.sslEnforcement] Enable ssl enforcement or not * when connect to server. Possible values include: 'Enabled', 'Disabled' * + * @param {string} [parameters.replicationRole] The replication role of the + * server. + * * @param {object} [parameters.tags] Application-specific metadata in the form * of key-value pairs. * diff --git a/lib/services/mysqlManagement/package.json b/lib/services/mysqlManagement/package.json index 13cb795048..2a7ae85538 100644 --- a/lib/services/mysqlManagement/package.json +++ b/lib/services/mysqlManagement/package.json @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/mySQLManagementClient.js", "types": "./lib/mySQLManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/mysqlManagement", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git"