From 2a6cef28f33d6a589e74b2f00c043a0a75bf5757 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 30 Jul 2018 16:19:42 +0000 Subject: [PATCH 1/5] Generated from ddc68a8949630bf9901fa4480f9a63e2cfe2a22f rename operationId --- .../lib/models/credentialResult.js | 62 +++ .../lib/models/credentialResults.js | 63 +++ .../lib/models/index.d.ts | 26 + .../lib/models/index.js | 2 + .../lib/operations/index.d.ts | 130 +++++ .../lib/operations/managedClusters.js | 478 ++++++++++++++++++ 6 files changed, 761 insertions(+) create mode 100644 lib/services/containerservicesManagement/lib/models/credentialResult.js create mode 100644 lib/services/containerservicesManagement/lib/models/credentialResults.js diff --git a/lib/services/containerservicesManagement/lib/models/credentialResult.js b/lib/services/containerservicesManagement/lib/models/credentialResult.js new file mode 100644 index 0000000000..7cf3ea6d39 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/credentialResult.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'; + +/** + * The credential result response. + * + */ +class CredentialResult { + /** + * Create a CredentialResult. + * @member {string} [name] The name of the credential. + * @member {string} [value] The value of the credential. + */ + constructor() { + } + + /** + * Defines the metadata of CredentialResult + * + * @returns {object} metadata of CredentialResult + * + */ + mapper() { + return { + required: false, + serializedName: 'CredentialResult', + type: { + name: 'Composite', + className: 'CredentialResult', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + readOnly: true, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CredentialResult; diff --git a/lib/services/containerservicesManagement/lib/models/credentialResults.js b/lib/services/containerservicesManagement/lib/models/credentialResults.js new file mode 100644 index 0000000000..7fa8fb898a --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/credentialResults.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The list of credential result response. + * + */ +class CredentialResults { + /** + * Create a CredentialResults. + * @member {array} [values] + */ + constructor() { + } + + /** + * Defines the metadata of CredentialResults + * + * @returns {object} metadata of CredentialResults + * + */ + mapper() { + return { + required: false, + serializedName: 'CredentialResults', + type: { + name: 'Composite', + className: 'CredentialResults', + modelProperties: { + values: { + required: false, + readOnly: true, + serializedName: 'values', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CredentialResultElementType', + type: { + name: 'Composite', + className: 'CredentialResult' + } + } + } + } + } + } + }; + } +} + +module.exports = CredentialResults; diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index c4c8aa7670..4845a2ed6e 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -881,6 +881,32 @@ export interface ManagedClusterUpgradeProfile { agentPoolProfiles: ManagedClusterPoolUpgradeProfile[]; } +/** + * @class + * Initializes a new instance of the CredentialResult class. + * @constructor + * The credential result response. + * + * @member {string} [name] The name of the credential. + * @member {string} [value] The value of the credential. + */ +export interface CredentialResult { + readonly name?: string; + readonly value?: string; +} + +/** + * @class + * Initializes a new instance of the CredentialResults class. + * @constructor + * The list of credential result response. + * + * @member {array} [values] + */ +export interface CredentialResults { + readonly values?: CredentialResult[]; +} + /** * @class * Initializes a new instance of the OrchestratorVersionProfile class. diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index 9834540087..ac1d174e45 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -44,6 +44,8 @@ exports.OrchestratorProfile = require('./orchestratorProfile'); exports.ManagedClusterAccessProfile = require('./managedClusterAccessProfile'); exports.ManagedClusterPoolUpgradeProfile = require('./managedClusterPoolUpgradeProfile'); exports.ManagedClusterUpgradeProfile = require('./managedClusterUpgradeProfile'); +exports.CredentialResult = require('./credentialResult'); +exports.CredentialResults = require('./credentialResults'); exports.OrchestratorVersionProfile = require('./orchestratorVersionProfile'); exports.OrchestratorVersionProfileListResult = require('./orchestratorVersionProfileListResult'); exports.ContainerServiceListResult = require('./containerServiceListResult'); diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index ed4d5880bb..0ea29f5c48 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -1671,6 +1671,136 @@ export interface ManagedClusters { getAccessProfile(resourceGroupName: string, resourceName: string, roleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Gets clusteradmin credential of a managed cluster. + * + * Gets clusteradmin credential 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 {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. + */ + listClusterAdminCredentialsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets clusteradmin credential of a managed cluster. + * + * Gets clusteradmin credential 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 {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 {CredentialResults} - 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. + * + * {CredentialResults} [result] - The deserialized result object if an error did not occur. + * See {@link CredentialResults} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listClusterAdminCredentials(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listClusterAdminCredentials(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; + listClusterAdminCredentials(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets clusteruser credential of a managed cluster. + * + * Gets clusteruser credential 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 {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. + */ + listClusterUserCredentialsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets clusteruser credential of a managed cluster. + * + * Gets clusteruser credential 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 {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 {CredentialResults} - 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. + * + * {CredentialResults} [result] - The deserialized result object if an error did not occur. + * See {@link CredentialResults} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listClusterUserCredentials(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listClusterUserCredentials(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; + listClusterUserCredentials(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets a managed cluster. * diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index f62f060342..3b87ab2e87 100644 --- a/lib/services/containerservicesManagement/lib/operations/managedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/managedClusters.js @@ -592,6 +592,298 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c }); } +/** + * @summary Gets clusteradmin credential of a managed cluster. + * + * Gets clusteradmin credential 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 {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 CredentialResults} 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 _listClusterAdminCredentials(resourceGroupName, resourceName, 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 (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}/listClusterAdminCredential'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + 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['CredentialResults']().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 clusteruser credential of a managed cluster. + * + * Gets clusteruser credential 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 {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 CredentialResults} 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 _listClusterUserCredentials(resourceGroupName, resourceName, 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 (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}/listClusterUserCredential'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + 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['CredentialResults']().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 a managed cluster. * @@ -1888,6 +2180,8 @@ class ManagedClusters { this._listByResourceGroup = _listByResourceGroup; this._getUpgradeProfile = _getUpgradeProfile; this._getAccessProfile = _getAccessProfile; + this._listClusterAdminCredentials = _listClusterAdminCredentials; + this._listClusterUserCredentials = _listClusterUserCredentials; this._get = _get; this._createOrUpdate = _createOrUpdate; this._updateTags = _updateTags; @@ -2267,6 +2561,190 @@ class ManagedClusters { } } + /** + * @summary Gets clusteradmin credential of a managed cluster. + * + * Gets clusteradmin credential 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 {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. + */ + listClusterAdminCredentialsWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listClusterAdminCredentials(resourceGroupName, resourceName, 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 clusteradmin credential of a managed cluster. + * + * Gets clusteradmin credential 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 {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 {CredentialResults} - 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 CredentialResults} 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. + */ + listClusterAdminCredentials(resourceGroupName, resourceName, 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._listClusterAdminCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listClusterAdminCredentials(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * @summary Gets clusteruser credential of a managed cluster. + * + * Gets clusteruser credential 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 {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. + */ + listClusterUserCredentialsWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listClusterUserCredentials(resourceGroupName, resourceName, 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 clusteruser credential of a managed cluster. + * + * Gets clusteruser credential 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 {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 {CredentialResults} - 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 CredentialResults} 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. + */ + listClusterUserCredentials(resourceGroupName, resourceName, 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._listClusterUserCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listClusterUserCredentials(resourceGroupName, resourceName, options, optionalCallback); + } + } + /** * @summary Gets a managed cluster. * From cd8dd1dc38d1bd88a838c5e79040e10318cd4d9d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 7 Aug 2018 15:37:13 -0700 Subject: [PATCH 2/5] Generated from 975ed296c45967a863f23df750cd0aa4004afcbb (#3303) modify 2017-08-31 version --- .../lib/models/containerServiceLinuxProfile.js | 2 +- lib/services/containerservicesManagement/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js index 6cf2c02866..56c1403758 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js @@ -47,7 +47,7 @@ class ContainerServiceLinuxProfile { required: true, serializedName: 'adminUsername', constraints: { - Pattern: '^[a-z][a-z0-9_-]*$' + Pattern: '^[A-Za-z][-A-Za-z0-9_]*$' }, type: { name: 'String' diff --git a/lib/services/containerservicesManagement/package.json b/lib/services/containerservicesManagement/package.json index c9c96191e8..d68df6d24b 100644 --- a/lib/services/containerservicesManagement/package.json +++ b/lib/services/containerservicesManagement/package.json @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/containerServiceClient.js", "types": "./lib/containerServiceClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/containerservicesManagement", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" From 2b48528020f70e4882b556253505041d4080ae7b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 8 Aug 2018 09:34:47 -0700 Subject: [PATCH 3/5] Generated from b8860f73880880a13c2491f965f2aa8e58a01822 (#3307) modify credentialResults keyName to kubeconfigs --- .../lib/models/credentialResults.js | 6 +++--- .../containerservicesManagement/lib/models/index.d.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/services/containerservicesManagement/lib/models/credentialResults.js b/lib/services/containerservicesManagement/lib/models/credentialResults.js index 7fa8fb898a..550c9a367b 100644 --- a/lib/services/containerservicesManagement/lib/models/credentialResults.js +++ b/lib/services/containerservicesManagement/lib/models/credentialResults.js @@ -19,7 +19,7 @@ const models = require('./index'); class CredentialResults { /** * Create a CredentialResults. - * @member {array} [values] + * @member {array} [kubeconfigs] */ constructor() { } @@ -38,10 +38,10 @@ class CredentialResults { name: 'Composite', className: 'CredentialResults', modelProperties: { - values: { + kubeconfigs: { required: false, readOnly: true, - serializedName: 'values', + serializedName: 'kubeconfigs', type: { name: 'Sequence', element: { diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 5bf6482eb8..13efaeec01 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -891,10 +891,10 @@ export interface CredentialResult { * @constructor * The list of credential result response. * - * @member {array} [values] + * @member {array} [kubeconfigs] */ export interface CredentialResults { - readonly values?: CredentialResult[]; + readonly kubeconfigs?: CredentialResult[]; } /** From b4791bbc273ebd45621ef37cb71ffb6a5362ede2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 8 Aug 2018 13:50:03 -0700 Subject: [PATCH 4/5] Generated from 73dab353224c59ad704cdd7632f734e316128aa4 (#3313) fix credentialResult value format to byte --- .../lib/models/credentialResult.js | 4 ++-- .../containerservicesManagement/lib/models/index.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/services/containerservicesManagement/lib/models/credentialResult.js b/lib/services/containerservicesManagement/lib/models/credentialResult.js index 7cf3ea6d39..a90d468852 100644 --- a/lib/services/containerservicesManagement/lib/models/credentialResult.js +++ b/lib/services/containerservicesManagement/lib/models/credentialResult.js @@ -18,7 +18,7 @@ class CredentialResult { /** * Create a CredentialResult. * @member {string} [name] The name of the credential. - * @member {string} [value] The value of the credential. + * @member {buffer} [value] Base64-encoded Kubernetes configuration file. */ constructor() { } @@ -50,7 +50,7 @@ class CredentialResult { readOnly: true, serializedName: 'value', type: { - name: 'String' + name: 'ByteArray' } } } diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 13efaeec01..57c6766bc1 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -878,11 +878,11 @@ export interface ManagedClusterUpgradeProfile { * The credential result response. * * @member {string} [name] The name of the credential. - * @member {string} [value] The value of the credential. + * @member {buffer} [value] Base64-encoded Kubernetes configuration file. */ export interface CredentialResult { readonly name?: string; - readonly value?: string; + readonly value?: Buffer; } /** From 8217974694284f211636693212576323a3d4d652 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 29 Aug 2018 15:13:11 -0700 Subject: [PATCH 5/5] Regenerate azure-arm-containerservice and update version to 5.0.0 --- .../lib/models/containerServiceDiagnosticsProfile.js | 2 -- .../lib/models/containerServiceLinuxProfile.js | 2 -- .../lib/models/containerServiceServicePrincipalProfile.js | 2 -- .../lib/models/containerServiceSshConfiguration.js | 2 -- .../lib/models/credentialResults.js | 2 -- .../lib/models/managedClusterUpgradeProfile.js | 2 -- .../lib/models/orchestratorVersionProfile.js | 2 -- .../lib/models/orchestratorVersionProfileListResult.js | 2 -- lib/services/containerservicesManagement/package-lock.json | 2 +- lib/services/containerservicesManagement/package.json | 4 ++-- 10 files changed, 3 insertions(+), 19 deletions(-) diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js index 1ca0c5fa2d..2ba40526cb 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Profile for diagnostics on the container service cluster. * diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js index 56c1403758..ccd6312a79 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Profile for Linux VMs in the container service cluster. * diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js index 7823f2a0dd..462806938f 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a service principal identity for the cluster to use for * manipulating Azure APIs. Either secret or keyVaultSecretRef must be diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js b/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js index a77522abe0..51cd3fdead 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SSH configuration for Linux-based VMs running on Azure. * diff --git a/lib/services/containerservicesManagement/lib/models/credentialResults.js b/lib/services/containerservicesManagement/lib/models/credentialResults.js index 550c9a367b..c6c3842e35 100644 --- a/lib/services/containerservicesManagement/lib/models/credentialResults.js +++ b/lib/services/containerservicesManagement/lib/models/credentialResults.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of credential result response. * diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js index ddb99f2a26..633dcbc3a2 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of available upgrades for compute pools. * diff --git a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js index c72c478b43..a27be1de00 100644 --- a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js +++ b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The profile of an orchestrator and its available versions. * diff --git a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js index 4ce959deba..0aa579ef28 100644 --- a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js +++ b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of versions for supported orchestrators. * diff --git a/lib/services/containerservicesManagement/package-lock.json b/lib/services/containerservicesManagement/package-lock.json index fedc80d1b7..a27da3ac88 100644 --- a/lib/services/containerservicesManagement/package-lock.json +++ b/lib/services/containerservicesManagement/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-arm-containerservice", - "version": "4.0.0", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/lib/services/containerservicesManagement/package.json b/lib/services/containerservicesManagement/package.json index d68df6d24b..2833989116 100644 --- a/lib/services/containerservicesManagement/package.json +++ b/lib/services/containerservicesManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-containerservice", "author": "Microsoft Corporation", "description": "ContainerServiceClient Library with typescript type definitions for node", - "version": "4.0.0", + "version": "5.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/containerServiceClient.js", "types": "./lib/containerServiceClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/containerservicesManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git"