diff --git a/lib/services/containerservicesManagement/LICENSE.txt b/lib/services/containerservicesManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/containerservicesManagement/LICENSE.txt +++ b/lib/services/containerservicesManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/containerservicesManagement/README.md b/lib/services/containerservicesManagement/README.md index 5ef4c8eb2d..bcda4fd300 100644 --- a/lib/services/containerservicesManagement/README.md +++ b/lib/services/containerservicesManagement/README.md @@ -1,40 +1,40 @@ ---- -uid: azure-arm-containerservice -summary: *content - ---- -# Microsoft Azure SDK for Node.js - ContainerServiceClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-containerservice -``` - -## How to use - -### Authentication, client creation and list containerServices as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const ContainerServiceClient = require("azure-arm-containerservice"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new ContainerServiceClient(creds, subscriptionId); - return client.containerServices.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-containerservice +summary: *content + +--- +# Microsoft Azure SDK for Node.js - ContainerServiceClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-containerservice +``` + +## How to use + +### Authentication, client creation and list containerServices as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const ContainerServiceClient = require("azure-arm-containerservice"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new ContainerServiceClient(creds, subscriptionId); + return client.containerServices.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts index 1d29044a2b..67db569fd8 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts @@ -34,11 +34,11 @@ export default class ContainerServiceClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.js b/lib/services/containerservicesManagement/lib/containerServiceClient.js index 2651cd78d9..23e4792c0e 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.js +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.js @@ -34,9 +34,9 @@ class ContainerServiceClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { diff --git a/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js b/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js new file mode 100644 index 0000000000..fcbd0421cb --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js @@ -0,0 +1,60 @@ +/* + * 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 List Compute Operation operation response. + */ +class ComputeOperationListResult extends Array { + /** + * Create a ComputeOperationListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ComputeOperationListResult + * + * @returns {object} metadata of ComputeOperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationListResult', + type: { + name: 'Composite', + className: 'ComputeOperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ComputeOperationValueElementType', + type: { + name: 'Composite', + className: 'ComputeOperationValue' + } + } + } + } + } + } + }; + } +} + +module.exports = ComputeOperationListResult; diff --git a/lib/services/containerservicesManagement/lib/models/computeOperationValue.js b/lib/services/containerservicesManagement/lib/models/computeOperationValue.js new file mode 100644 index 0000000000..bb1f964dad --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/computeOperationValue.js @@ -0,0 +1,99 @@ +/* + * 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'; + +/** + * Describes the properties of a Compute Operation value. + * + */ +class ComputeOperationValue { + /** + * Create a ComputeOperationValue. + * @member {string} [origin] The origin of the compute operation. + * @member {string} [name] The name of the compute operation. + * @member {string} [operation] The display name of the compute operation. + * @member {string} [resource] The display name of the resource the operation + * applies to. + * @member {string} [description] The description of the operation. + * @member {string} [provider] The resource provider for the operation. + */ + constructor() { + } + + /** + * Defines the metadata of ComputeOperationValue + * + * @returns {object} metadata of ComputeOperationValue + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationValue', + type: { + name: 'Composite', + className: 'ComputeOperationValue', + modelProperties: { + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'display.operation', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'display.resource', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'display.description', + type: { + name: 'String' + } + }, + provider: { + required: false, + readOnly: true, + serializedName: 'display.provider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ComputeOperationValue; 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 45e6f8940b..5bf6482eb8 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -541,6 +541,34 @@ export interface OperationValue { readonly provider?: string; } +/** + * @class + * Initializes a new instance of the TagsObject class. + * @constructor + * Tags object for patch operations. + * + * @member {object} [tags] Resource tags. + */ +export interface TagsObject { + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ManagedClusterServicePrincipalProfile class. + * @constructor + * Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * + * @member {string} clientId The ID for the service principal. + * @member {string} [secret] The secret password associated with the service + * principal in plain text. + */ +export interface ManagedClusterServicePrincipalProfile { + clientId: string; + secret?: string; +} + /** * @class * Initializes a new instance of the ManagedClusterAgentPoolProfile class. @@ -605,16 +633,9 @@ export interface OperationValue { * @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} [dnsPrefix] DNS prefix to be used to create the FQDN for - * the agent pool. - * @member {string} [fqdn] FDQN for the agent pool. - * @member {array} [ports] Ports number array used to expose on this agent - * pool. The default opened ports are different based on your choice of - * orchestrator. * @member {string} [storageProfile] Storage profile specifies what kind of - * storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, - * we will choose for you based on the orchestrator choice. Possible values - * include: 'StorageAccount', 'ManagedDisks' + * 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. @@ -627,10 +648,7 @@ export interface ManagedClusterAgentPoolProfile { count?: number; vmSize: string; osDiskSizeGB?: number; - dnsPrefix?: string; - readonly fqdn?: string; - ports?: number[]; - storageProfile?: string; + readonly storageProfile?: string; vnetSubnetID?: string; maxPods?: number; osType?: string; @@ -725,19 +743,10 @@ export interface ManagedClusterAADProfile { * used to authenticate with Linux-based VMs. Only expect one key specified. * @member {object} [servicePrincipalProfile] Information about a service * principal identity for the cluster to use for manipulating Azure APIs. - * Either secret or keyVaultSecretRef must be specified. * @member {string} [servicePrincipalProfile.clientId] The ID for the service * principal. * @member {string} [servicePrincipalProfile.secret] The secret password * associated with the service principal in plain text. - * @member {object} [servicePrincipalProfile.keyVaultSecretRef] Reference to a - * secret stored in Azure Key Vault. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.vaultID] Key - * vault identifier. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.secretName] The - * secret name. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.version] The - * secret version. * @member {object} [addonProfiles] Profile of managed cluster add-on. * @member {string} [nodeResourceGroup] Name of the resource group containing * agent pool nodes. @@ -776,7 +785,7 @@ export interface ManagedCluster extends Resource { readonly fqdn?: string; agentPoolProfiles?: ManagedClusterAgentPoolProfile[]; linuxProfile?: ContainerServiceLinuxProfile; - servicePrincipalProfile?: ContainerServiceServicePrincipalProfile; + servicePrincipalProfile?: ManagedClusterServicePrincipalProfile; addonProfiles?: { [propertyName: string]: ManagedClusterAddonProfile }; readonly nodeResourceGroup?: string; enableRBAC?: boolean; @@ -862,6 +871,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 cff5de796f..ac1d174e45 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -33,6 +33,8 @@ exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); exports.ContainerService = require('./containerService'); exports.OperationValue = require('./operationValue'); +exports.TagsObject = require('./tagsObject'); +exports.ManagedClusterServicePrincipalProfile = require('./managedClusterServicePrincipalProfile'); exports.ManagedClusterAgentPoolProfile = require('./managedClusterAgentPoolProfile'); exports.ContainerServiceNetworkProfile = require('./containerServiceNetworkProfile'); exports.ManagedClusterAddonProfile = require('./managedClusterAddonProfile'); @@ -42,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/models/managedCluster.js b/lib/services/containerservicesManagement/lib/models/managedCluster.js index 3cf2f5df4c..7d0c528534 100644 --- a/lib/services/containerservicesManagement/lib/models/managedCluster.js +++ b/lib/services/containerservicesManagement/lib/models/managedCluster.js @@ -38,19 +38,10 @@ class ManagedCluster extends models['Resource'] { * used to authenticate with Linux-based VMs. Only expect one key specified. * @member {object} [servicePrincipalProfile] Information about a service * principal identity for the cluster to use for manipulating Azure APIs. - * Either secret or keyVaultSecretRef must be specified. * @member {string} [servicePrincipalProfile.clientId] The ID for the service * principal. * @member {string} [servicePrincipalProfile.secret] The secret password * associated with the service principal in plain text. - * @member {object} [servicePrincipalProfile.keyVaultSecretRef] Reference to - * a secret stored in Azure Key Vault. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.vaultID] Key - * vault identifier. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.secretName] - * The secret name. - * @member {string} [servicePrincipalProfile.keyVaultSecretRef.version] The - * secret version. * @member {object} [addonProfiles] Profile of managed cluster add-on. * @member {string} [nodeResourceGroup] Name of the resource group containing * agent pool nodes. @@ -203,7 +194,7 @@ class ManagedCluster extends models['Resource'] { serializedName: 'properties.servicePrincipalProfile', type: { name: 'Composite', - className: 'ContainerServiceServicePrincipalProfile' + className: 'ManagedClusterServicePrincipalProfile' } }, addonProfiles: { diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js index 4143e11309..9164a04bab 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js @@ -77,16 +77,9 @@ 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} [dnsPrefix] DNS prefix to be used to create the FQDN for - * the agent pool. - * @member {string} [fqdn] FDQN for the agent pool. - * @member {array} [ports] Ports number array used to expose on this agent - * pool. The default opened ports are different based on your choice of - * orchestrator. * @member {string} [storageProfile] Storage profile specifies what kind of - * storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, - * we will choose for you based on the orchestrator choice. Possible values - * include: 'StorageAccount', 'ManagedDisks' + * 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. @@ -144,37 +137,9 @@ class ManagedClusterAgentPoolProfile { name: 'Number' } }, - dnsPrefix: { - required: false, - serializedName: 'dnsPrefix', - type: { - name: 'String' - } - }, - fqdn: { - required: false, - readOnly: true, - serializedName: 'fqdn', - type: { - name: 'String' - } - }, - ports: { - required: false, - serializedName: 'ports', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NumberElementType', - type: { - name: 'Number' - } - } - } - }, storageProfile: { required: false, + readOnly: true, serializedName: 'storageProfile', type: { name: 'String' diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterServicePrincipalProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterServicePrincipalProfile.js new file mode 100644 index 0000000000..f9980faee0 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/managedClusterServicePrincipalProfile.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'; + +/** + * Information about a service principal identity for the cluster to use for + * manipulating Azure APIs. + * + */ +class ManagedClusterServicePrincipalProfile { + /** + * Create a ManagedClusterServicePrincipalProfile. + * @member {string} clientId The ID for the service principal. + * @member {string} [secret] The secret password associated with the service + * principal in plain text. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedClusterServicePrincipalProfile + * + * @returns {object} metadata of ManagedClusterServicePrincipalProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedClusterServicePrincipalProfile', + type: { + name: 'Composite', + className: 'ManagedClusterServicePrincipalProfile', + modelProperties: { + clientId: { + required: true, + serializedName: 'clientId', + type: { + name: 'String' + } + }, + secret: { + required: false, + serializedName: 'secret', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedClusterServicePrincipalProfile; diff --git a/lib/services/containerservicesManagement/lib/models/tagsObject.js b/lib/services/containerservicesManagement/lib/models/tagsObject.js new file mode 100644 index 0000000000..755b116391 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/tagsObject.js @@ -0,0 +1,59 @@ +/* + * 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'; + +/** + * Tags object for patch operations. + * + */ +class TagsObject { + /** + * Create a TagsObject. + * @member {object} [tags] Resource tags. + */ + constructor() { + } + + /** + * Defines the metadata of TagsObject + * + * @returns {object} metadata of TagsObject + * + */ + mapper() { + return { + required: false, + serializedName: 'TagsObject', + type: { + name: 'Composite', + className: 'TagsObject', + modelProperties: { + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = TagsObject; diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index b3cea45cdc..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. * @@ -1772,7 +1902,7 @@ export interface ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -1780,20 +1910,6 @@ export interface ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -1894,7 +2010,7 @@ export interface ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -1902,20 +2018,6 @@ export interface ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -1999,6 +2101,79 @@ export interface ManagedClusters { createOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.ManagedCluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ManagedCluster} - 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. + * + * {ManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Deletes a managed cluster. * @@ -2097,7 +2272,7 @@ export interface ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2105,20 +2280,6 @@ export interface ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2219,7 +2380,7 @@ export interface ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2227,20 +2388,6 @@ export interface ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2324,6 +2471,79 @@ export interface ManagedClusters { beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.ManagedCluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ManagedCluster} - 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. + * + * {ManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Deletes a managed cluster. * diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index bc88d28ea8..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. * @@ -775,7 +1067,7 @@ function _get(resourceGroupName, resourceName, options, callback) { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -783,20 +1075,6 @@ function _get(resourceGroupName, resourceName, options, callback) { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -919,6 +1197,91 @@ function _createOrUpdate(resourceGroupName, resourceName, parameters, options, c } +/** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} 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 _updateTags(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedCluster']().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 Deletes a managed cluster. * @@ -1019,7 +1382,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -1027,20 +1390,6 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -1078,19 +1427,203 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * @param {string} parameters.aadProfile.clientAppID The client AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppID The server AAD application - * ID. + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '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 (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + 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}'; + 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 = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedCluster']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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['ManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD - * application secret. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use - * for authentication. If not specified, will use the tenant of the deployment - * subscription. + * @param {string} resourceName The name of the managed cluster resource. * - * @param {string} parameters.location Resource location + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [parameters.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -1110,7 +1643,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { +function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1156,7 +1689,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1179,7 +1712,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio let requestModel = null; try { if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['ManagedCluster']().mapper(); + let requestModelMapper = new client.models['TagsObject']().mapper(); requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); requestContent = JSON.stringify(requestModel); } @@ -1195,7 +1728,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1240,23 +1773,6 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio return callback(deserializationError); } } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ManagedCluster']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); @@ -1664,10 +2180,14 @@ 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; this._deleteMethod = _deleteMethod; this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; this._beginDeleteMethod = _beginDeleteMethod; this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; @@ -1774,15 +2294,203 @@ class ManagedClusters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists managed clusters in the specified subscription and resource + * group. + * + * Lists managed clusters in the specified subscription and resource group. The + * operation returns properties of each managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedClusterListResult} - 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 ManagedClusterListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listByResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Gets upgrade profile for a managed cluster. + * + * Gets the details of the upgrade profile for a 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. + */ + getUpgradeProfileWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getUpgradeProfile(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 upgrade profile for a managed cluster. + * + * Gets the details of the upgrade profile for a 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 {ManagedClusterUpgradeProfile} - 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 ManagedClusterUpgradeProfile} 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. + */ + getUpgradeProfile(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._getUpgradeProfile(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getUpgradeProfile(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * @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. */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + getAccessProfileWithHttpOperationResponse(resourceGroupName, resourceName, roleName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1793,14 +2501,18 @@ class ManagedClusters { } /** - * @summary Lists managed clusters in the specified subscription and resource - * group. + * @summary Gets an access profile of a managed cluster. * - * Lists managed clusters in the specified subscription and resource group. The - * operation returns properties of each 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 @@ -1813,7 +2525,7 @@ class ManagedClusters { * * {Promise} A promise is returned * - * @resolve {ManagedClusterListResult} - The deserialized result object. + * @resolve {ManagedClusterAccessProfile} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1822,14 +2534,14 @@ class ManagedClusters { * {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 ManagedClusterListResult} for more + * 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. */ - listByResourceGroup(resourceGroupName, options, optionalCallback) { + getAccessProfile(resourceGroupName, resourceName, roleName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1838,22 +2550,22 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + self._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + return self._getAccessProfile(resourceGroupName, resourceName, roleName, options, optionalCallback); } } /** - * @summary Gets upgrade profile for a managed cluster. + * @summary Gets clusteradmin credential of a managed cluster. * - * Gets the details of the upgrade profile for a managed cluster with a - * specified resource group and name. + * Gets clusteradmin credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -1866,15 +2578,15 @@ class ManagedClusters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getUpgradeProfileWithHttpOperationResponse(resourceGroupName, resourceName, options) { + listClusterAdminCredentialsWithHttpOperationResponse(resourceGroupName, resourceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getUpgradeProfile(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._listClusterAdminCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1885,10 +2597,10 @@ class ManagedClusters { } /** - * @summary Gets upgrade profile for a managed cluster. + * @summary Gets clusteradmin credential of a managed cluster. * - * Gets the details of the upgrade profile for a managed cluster with a - * specified resource group and name. + * Gets clusteradmin credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -1906,7 +2618,7 @@ class ManagedClusters { * * {Promise} A promise is returned * - * @resolve {ManagedClusterUpgradeProfile} - The deserialized result object. + * @resolve {CredentialResults} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1915,14 +2627,13 @@ class ManagedClusters { * {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 ManagedClusterUpgradeProfile} for more - * information. + * 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. */ - getUpgradeProfile(resourceGroupName, resourceName, options, optionalCallback) { + listClusterAdminCredentials(resourceGroupName, resourceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1931,30 +2642,27 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getUpgradeProfile(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._listClusterAdminCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getUpgradeProfile(resourceGroupName, resourceName, options, optionalCallback); + return self._listClusterAdminCredentials(resourceGroupName, resourceName, options, optionalCallback); } } /** - * @summary Gets an access profile of a managed cluster. + * @summary Gets clusteruser credential of a managed cluster. * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. + * 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 {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 @@ -1962,15 +2670,15 @@ class ManagedClusters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAccessProfileWithHttpOperationResponse(resourceGroupName, resourceName, roleName, options) { + listClusterUserCredentialsWithHttpOperationResponse(resourceGroupName, resourceName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { + self._listClusterUserCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1981,18 +2689,15 @@ class ManagedClusters { } /** - * @summary Gets an access profile of a managed cluster. + * @summary Gets clusteruser credential of a managed cluster. * - * Gets the accessProfile for the specified role name of the managed cluster - * with a specified resource group and name. + * 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 {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 @@ -2005,7 +2710,7 @@ class ManagedClusters { * * {Promise} A promise is returned * - * @resolve {ManagedClusterAccessProfile} - The deserialized result object. + * @resolve {CredentialResults} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2014,14 +2719,13 @@ class ManagedClusters { * {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. + * 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. */ - getAccessProfile(resourceGroupName, resourceName, roleName, options, optionalCallback) { + listClusterUserCredentials(resourceGroupName, resourceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2030,14 +2734,14 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAccessProfile(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { + self._listClusterUserCredentials(resourceGroupName, resourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAccessProfile(resourceGroupName, resourceName, roleName, options, optionalCallback); + return self._listClusterUserCredentials(resourceGroupName, resourceName, options, optionalCallback); } } @@ -2169,7 +2873,7 @@ class ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2177,20 +2881,6 @@ class ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2303,7 +2993,7 @@ class ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2311,20 +3001,6 @@ class ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2423,6 +3099,106 @@ class ManagedClusters { } } + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedCluster} - 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 ManagedCluster} 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. + */ + updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + /** * @summary Deletes a managed cluster. * @@ -2548,7 +3324,7 @@ class ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2556,20 +3332,6 @@ class ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2682,7 +3444,7 @@ class ManagedClusters { * * @param {object} [parameters.servicePrincipalProfile] Information about a * service principal identity for the cluster to use for manipulating Azure - * APIs. Either secret or keyVaultSecretRef must be specified. + * APIs. * * @param {string} parameters.servicePrincipalProfile.clientId The ID for the * service principal. @@ -2690,20 +3452,6 @@ class ManagedClusters { * @param {string} [parameters.servicePrincipalProfile.secret] The secret * password associated with the service principal in plain text. * - * @param {object} [parameters.servicePrincipalProfile.keyVaultSecretRef] - * Reference to a secret stored in Azure Key Vault. - * - * @param {string} parameters.servicePrincipalProfile.keyVaultSecretRef.vaultID - * Key vault identifier. - * - * @param {string} - * parameters.servicePrincipalProfile.keyVaultSecretRef.secretName The secret - * name. - * - * @param {string} - * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret - * version. - * * @param {object} [parameters.addonProfiles] Profile of managed cluster * add-on. * @@ -2802,6 +3550,106 @@ class ManagedClusters { } } + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedCluster} - 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 ManagedCluster} 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. + */ + beginUpdateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + /** * @summary Deletes a managed cluster. * diff --git a/lib/services/containerservicesManagement/package-lock.json b/lib/services/containerservicesManagement/package-lock.json index aa3d4d8eaa..fedc80d1b7 100644 --- a/lib/services/containerservicesManagement/package-lock.json +++ b/lib/services/containerservicesManagement/package-lock.json @@ -1,6 +1,6 @@ { "name": "azure-arm-containerservice", - "version": "1.0.0-preview", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/lib/services/containerservicesManagement/package.json b/lib/services/containerservicesManagement/package.json index dd8c3f583e..c9c96191e8 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": "3.0.0", + "version": "4.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/containerServiceClient.js", "types": "./lib/containerServiceClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/containerservicesManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } }