diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 57c6766bc1..7a4fcbd20f 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -577,7 +577,7 @@ export interface ManagedClusterServicePrincipalProfile { * * @member {string} name Unique name of the agent pool profile in the context * of the subscription and resource group. - * @member {number} [count] Number of agents (VMs) to host docker containers. + * @member {number} count Number of agents (VMs) to host docker containers. * Allowed values must be in the range of 1 to 100 (inclusive). The default * value is 1. . Default value: 1 . * @member {string} vmSize Size of agent VMs. Possible values include: @@ -633,25 +633,31 @@ export interface ManagedClusterServicePrincipalProfile { * @member {number} [osDiskSizeGB] OS Disk Size in GB to be used to specify the * disk size for every machine in this master/agent pool. If you specify 0, it * will apply the default osDisk size according to the vmSize specified. - * @member {string} [storageProfile] Storage profile specifies what kind of - * storage used. Defaults to ManagedDisks. Possible values include: - * 'StorageAccount', 'ManagedDisks' * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet * identifier. * @member {number} [maxPods] Maximum number of pods that can run on a node. * @member {string} [osType] OsType to be used to specify os type. Choose from * Linux and Windows. Default to Linux. Possible values include: 'Linux', * 'Windows'. Default value: 'Linux' . + * @member {number} [maxCount] Maximun number of nodes for auto-scaling + * @member {number} [minCount] Minimun number of nodes for auto-scaling + * @member {boolean} [enableAutoScaling] Wheter to enable auto-scaler + * @member {string} [type] AgentPoolType represents types of agentpool. + * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'. + * Default value: 'VirtualMachineScaleSets' . */ export interface ManagedClusterAgentPoolProfile { name: string; - count?: number; + count: number; vmSize: string; osDiskSizeGB?: number; - readonly storageProfile?: string; vnetSubnetID?: string; maxPods?: number; osType?: string; + maxCount?: number; + minCount?: number; + enableAutoScaling?: boolean; + type?: string; } /** @@ -808,18 +814,6 @@ export interface OrchestratorProfile { orchestratorVersion: string; } -/** - * @class - * Initializes a new instance of the ManagedClusterAccessProfile class. - * @constructor - * Managed cluster Access Profile. - * - * @member {buffer} [kubeConfig] Base64-encoded Kubernetes configuration file. - */ -export interface ManagedClusterAccessProfile extends Resource { - kubeConfig?: Buffer; -} - /** * @class * Initializes a new instance of the ManagedClusterPoolUpgradeProfile class. diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index ac1d174e45..c51f44f99b 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -41,7 +41,6 @@ exports.ManagedClusterAddonProfile = require('./managedClusterAddonProfile'); exports.ManagedClusterAADProfile = require('./managedClusterAADProfile'); exports.ManagedCluster = require('./managedCluster'); exports.OrchestratorProfile = require('./orchestratorProfile'); -exports.ManagedClusterAccessProfile = require('./managedClusterAccessProfile'); exports.ManagedClusterPoolUpgradeProfile = require('./managedClusterPoolUpgradeProfile'); exports.ManagedClusterUpgradeProfile = require('./managedClusterUpgradeProfile'); exports.CredentialResult = require('./credentialResult'); diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js index 9164a04bab..3c9387c3eb 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js @@ -19,7 +19,7 @@ class ManagedClusterAgentPoolProfile { * Create a ManagedClusterAgentPoolProfile. * @member {string} name Unique name of the agent pool profile in the context * of the subscription and resource group. - * @member {number} [count] Number of agents (VMs) to host docker containers. + * @member {number} count Number of agents (VMs) to host docker containers. * Allowed values must be in the range of 1 to 100 (inclusive). The default * value is 1. . Default value: 1 . * @member {string} vmSize Size of agent VMs. Possible values include: @@ -77,15 +77,18 @@ class ManagedClusterAgentPoolProfile { * the disk size for every machine in this master/agent pool. If you specify * 0, it will apply the default osDisk size according to the vmSize * specified. - * @member {string} [storageProfile] Storage profile specifies what kind of - * storage used. Defaults to ManagedDisks. Possible values include: - * 'StorageAccount', 'ManagedDisks' * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet * identifier. * @member {number} [maxPods] Maximum number of pods that can run on a node. * @member {string} [osType] OsType to be used to specify os type. Choose * from Linux and Windows. Default to Linux. Possible values include: * 'Linux', 'Windows'. Default value: 'Linux' . + * @member {number} [maxCount] Maximun number of nodes for auto-scaling + * @member {number} [minCount] Minimun number of nodes for auto-scaling + * @member {boolean} [enableAutoScaling] Wheter to enable auto-scaler + * @member {string} [type] AgentPoolType represents types of agentpool. + * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'. + * Default value: 'VirtualMachineScaleSets' . */ constructor() { } @@ -112,7 +115,7 @@ class ManagedClusterAgentPoolProfile { } }, count: { - required: false, + required: true, serializedName: 'count', defaultValue: 1, constraints: { @@ -137,14 +140,6 @@ class ManagedClusterAgentPoolProfile { name: 'Number' } }, - storageProfile: { - required: false, - readOnly: true, - serializedName: 'storageProfile', - type: { - name: 'String' - } - }, vnetSubnetID: { required: false, serializedName: 'vnetSubnetID', @@ -166,6 +161,35 @@ class ManagedClusterAgentPoolProfile { type: { name: 'String' } + }, + maxCount: { + required: false, + serializedName: 'maxCount', + type: { + name: 'Number' + } + }, + minCount: { + required: false, + serializedName: 'minCount', + type: { + name: 'Number' + } + }, + enableAutoScaling: { + required: false, + serializedName: 'enableAutoScaling', + type: { + name: 'Boolean' + } + }, + type: { + required: false, + serializedName: 'type', + defaultValue: 'VirtualMachineScaleSets', + type: { + name: 'String' + } } } } diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index 0ea29f5c48..761e394c65 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -1599,78 +1599,6 @@ export interface ManagedClusters { getUpgradeProfile(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * @summary Gets an access profile of a managed cluster. - * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAccessProfileWithHttpOperationResponse(resourceGroupName: string, resourceName: string, roleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets an access profile of a managed cluster. - * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ManagedClusterAccessProfile} - 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. - * - * {ManagedClusterAccessProfile} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterAccessProfile} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAccessProfile(resourceGroupName: string, resourceName: string, roleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAccessProfile(resourceGroupName: string, resourceName: string, roleName: string, callback: ServiceCallback): void; - getAccessProfile(resourceGroupName: string, resourceName: string, roleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets clusteradmin credential of a managed cluster. * diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index 3b87ab2e87..a2c6481b7f 100644 --- a/lib/services/containerservicesManagement/lib/operations/managedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/managedClusters.js @@ -49,7 +49,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -187,7 +187,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -330,7 +330,7 @@ function _getUpgradeProfile(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -438,160 +438,6 @@ function _getUpgradeProfile(resourceGroupName, resourceName, options, callback) }); } -/** - * @summary Gets an access profile of a managed cluster. - * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterAccessProfile} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getAccessProfile(resourceGroupName, resourceName, roleName, 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 = '2018-03-31'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { - throw new Error('resourceName cannot be null or undefined and it must be of type string.'); - } - if (roleName === null || roleName === undefined || typeof roleName.valueOf() !== 'string') { - throw new Error('roleName 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.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); - requestUrl = requestUrl.replace('{roleName}', encodeURIComponent(roleName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'POST'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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['ManagedClusterAccessProfile']().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); - }); -} - /** * @summary Gets clusteradmin credential of a managed cluster. * @@ -630,7 +476,7 @@ function _listClusterAdminCredentials(resourceGroupName, resourceName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -776,7 +622,7 @@ function _listClusterUserCredentials(resourceGroupName, resourceName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -922,7 +768,7 @@ function _get(resourceGroupName, resourceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1469,7 +1315,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1653,7 +1499,7 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1814,7 +1660,7 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2179,7 +2025,6 @@ class ManagedClusters { this._list = _list; this._listByResourceGroup = _listByResourceGroup; this._getUpgradeProfile = _getUpgradeProfile; - this._getAccessProfile = _getAccessProfile; this._listClusterAdminCredentials = _listClusterAdminCredentials; this._listClusterUserCredentials = _listClusterUserCredentials; this._get = _get; @@ -2462,105 +2307,6 @@ class ManagedClusters { } } - /** - * @summary Gets an access profile of a managed cluster. - * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAccessProfileWithHttpOperationResponse(resourceGroupName, resourceName, roleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets an access profile of a managed cluster. - * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ManagedClusterAccessProfile} - 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 ManagedClusterAccessProfile} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAccessProfile(resourceGroupName, resourceName, roleName, 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._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAccessProfile(resourceGroupName, resourceName, roleName, options, optionalCallback); - } - } - /** * @summary Gets clusteradmin credential of a managed cluster. * diff --git a/lib/services/containerservicesManagement/lib/operations/operations.js b/lib/services/containerservicesManagement/lib/operations/operations.js index 1ffa97face..8cf8e3a30d 100644 --- a/lib/services/containerservicesManagement/lib/operations/operations.js +++ b/lib/services/containerservicesManagement/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-03-31'; + let apiVersion = '2018-08-01-preview'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {