diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts index 988e12858e..e5ce79d920 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts @@ -58,6 +58,7 @@ export default class ContainerServiceClient extends AzureServiceClient { containerServices: operations.ContainerServices; operations: operations.Operations; managedClusters: operations.ManagedClusters; + agentPools: operations.AgentPools; } export { ContainerServiceClient, models as ContainerServiceModels }; diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.js b/lib/services/containerservicesManagement/lib/containerServiceClient.js index 142bb2aa12..e7f1d4ee44 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.js +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.js @@ -75,6 +75,7 @@ class ContainerServiceClient extends ServiceClient { this.containerServices = new operations.ContainerServices(this); this.operations = new operations.Operations(this); this.managedClusters = new operations.ManagedClusters(this); + this.agentPools = new operations.AgentPools(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/containerservicesManagement/lib/models/agentPool.js b/lib/services/containerservicesManagement/lib/models/agentPool.js new file mode 100644 index 0000000000..fd23bc88c4 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/agentPool.js @@ -0,0 +1,238 @@ +/* + * 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'); + +/** + * Agent Pool. + * + * @extends models['SubResource'] + */ +class AgentPool extends models['SubResource'] { + /** + * Create a AgentPool. + * @property {number} count Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @property {string} vmSize Size of agent VMs. Possible values include: + * 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', + * 'Standard_DS3', 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', + * 'Standard_DS4', 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', + * 'Standard_DS5_v2', 'Standard_DS5_v2_Promo', 'Standard_E16_v3', + * 'Standard_E16s_v3', 'Standard_E2_v3', 'Standard_E2s_v3', + * 'Standard_E32-16s_v3', 'Standard_E32-8s_v3', 'Standard_E32_v3', + * 'Standard_E32s_v3', 'Standard_E4_v3', 'Standard_E4s_v3', + * 'Standard_E64-16s_v3', 'Standard_E64-32s_v3', 'Standard_E64_v3', + * 'Standard_E64s_v3', 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', + * 'Standard_F16', 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', + * 'Standard_F2', 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', + * 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', + * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', + * 'Standard_GS4-4', 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', + * 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', + * 'Standard_H16r', 'Standard_H8', 'Standard_H8m', 'Standard_L16s', + * 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', + * 'Standard_M128-64ms', 'Standard_M128ms', 'Standard_M128s', + * 'Standard_M64-16ms', 'Standard_M64-32ms', 'Standard_M64ms', + * 'Standard_M64s', 'Standard_NC12', 'Standard_NC12s_v2', + * 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', + * 'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', + * 'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * @property {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. + * @property {string} [vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * @property {number} [maxPods] Maximum number of pods that can run on a + * node. + * @property {string} [osType] OsType to be used to specify os type. Choose + * from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows'. Default value: 'Linux' . + * @property {number} [maxCount] Maximum number of nodes for auto-scaling + * @property {number} [minCount] Minimum number of nodes for auto-scaling + * @property {boolean} [enableAutoScaling] Whether to enable auto-scaler + * @property {string} [agentPoolType] AgentPoolType represents types of an + * agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * @property {string} [orchestratorVersion] Version of orchestrator specified + * when creating the managed cluster. + * @property {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AgentPool + * + * @returns {object} metadata of AgentPool + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentPool', + type: { + name: 'Composite', + className: 'AgentPool', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + count: { + required: true, + serializedName: 'properties.count', + defaultValue: 1, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'properties.vmSize', + type: { + name: 'String' + } + }, + osDiskSizeGB: { + required: false, + serializedName: 'properties.osDiskSizeGB', + type: { + name: 'Number' + } + }, + vnetSubnetID: { + required: false, + serializedName: 'properties.vnetSubnetID', + type: { + name: 'String' + } + }, + maxPods: { + required: false, + serializedName: 'properties.maxPods', + type: { + name: 'Number' + } + }, + osType: { + required: false, + serializedName: 'properties.osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + }, + maxCount: { + required: false, + serializedName: 'properties.maxCount', + type: { + name: 'Number' + } + }, + minCount: { + required: false, + serializedName: 'properties.minCount', + type: { + name: 'Number' + } + }, + enableAutoScaling: { + required: false, + serializedName: 'properties.enableAutoScaling', + type: { + name: 'Boolean' + } + }, + agentPoolType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'String' + } + }, + orchestratorVersion: { + required: false, + serializedName: 'properties.orchestratorVersion', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AgentPool; diff --git a/lib/services/containerservicesManagement/lib/models/agentPoolListResult.js b/lib/services/containerservicesManagement/lib/models/agentPoolListResult.js new file mode 100644 index 0000000000..2362d48be3 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/agentPoolListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List Agent Pools operation. + */ +class AgentPoolListResult extends Array { + /** + * Create a AgentPoolListResult. + * @property {string} [nextLink] The URL to get the next set of agent pool + * results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AgentPoolListResult + * + * @returns {object} metadata of AgentPoolListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'AgentPoolListResult', + type: { + name: 'Composite', + className: 'AgentPoolListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AgentPoolElementType', + type: { + name: 'Composite', + className: 'AgentPool' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AgentPoolListResult; diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 6c25238f8e..c4815a9a31 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -657,6 +657,25 @@ export interface OperationValue { readonly provider?: string; } +/** + * Reference to another subresource. + */ +export interface SubResource extends BaseResource { + /** + * Resource ID. + */ + readonly id?: string; + /** + * The name of the resource that is unique within a resource group. This name can be used to + * access the resource. + */ + readonly name?: string; + /** + * Resource type + */ + readonly type?: string; +} + /** * Information about a service principal identity for the cluster to use for manipulating Azure * APIs. @@ -672,14 +691,116 @@ export interface ManagedClusterServicePrincipalProfile { secret?: string; } +/** + * Properties for the container service agent pool profile. + */ +export interface ManagedClusterAgentPoolProfileProperties { + /** + * Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to + * 100 (inclusive). The default value is 1. + */ + count: number; + /** + * Size of agent VMs. Possible values include: 'Standard_A1', 'Standard_A10', 'Standard_A11', + * 'Standard_A1_v2', 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', 'Standard_A6', + * 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', 'Standard_A8m_v2', 'Standard_A9', + * 'Standard_B2ms', 'Standard_B2s', 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', + * 'Standard_D11', 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', 'Standard_D12_v2', + * 'Standard_D12_v2_Promo', 'Standard_D13', 'Standard_D13_v2', 'Standard_D13_v2_Promo', + * 'Standard_D14', 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', 'Standard_D2_v2', + * 'Standard_D2_v2_Promo', 'Standard_D2_v3', 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', + * 'Standard_D32s_v3', 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', 'Standard_D5_v2', + * 'Standard_D5_v2_Promo', 'Standard_D64_v3', 'Standard_D64s_v3', 'Standard_D8_v3', + * 'Standard_D8s_v3', 'Standard_DS1', 'Standard_DS11', 'Standard_DS11_v2', + * 'Standard_DS11_v2_Promo', 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', 'Standard_DS13_v2', + * 'Standard_DS13_v2_Promo', 'Standard_DS14', 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', + * 'Standard_DS14_v2', 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', 'Standard_DS3_v2', + * 'Standard_DS3_v2_Promo', 'Standard_DS4', 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', + * 'Standard_DS5_v2', 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', 'Standard_E32-8s_v3', + * 'Standard_E32_v3', 'Standard_E32s_v3', 'Standard_E4_v3', 'Standard_E4s_v3', + * 'Standard_E64-16s_v3', 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', 'Standard_F16s', + * 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', 'Standard_F2s', 'Standard_F2s_v2', + * 'Standard_F32s_v2', 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', 'Standard_GS4-8', 'Standard_GS5', + * 'Standard_GS5-16', 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', + * 'Standard_H16r', 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', 'Standard_M128ms', + * 'Standard_M128s', 'Standard_M64-16ms', 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', + * 'Standard_NC12', 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', 'Standard_NC24s_v3', + * 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', + * 'Standard_ND24s', 'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + */ + vmSize: string; + /** + * 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. + */ + osDiskSizeGB?: number; + /** + * VNet SubnetID specifies the VNet's subnet identifier. + */ + vnetSubnetID?: string; + /** + * Maximum number of pods that can run on a node. + */ + maxPods?: number; + /** + * OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. + * Possible values include: 'Linux', 'Windows' + */ + osType?: string; + /** + * Maximum number of nodes for auto-scaling + */ + maxCount?: number; + /** + * Minimum number of nodes for auto-scaling + */ + minCount?: number; + /** + * Whether to enable auto-scaler + */ + enableAutoScaling?: boolean; + /** + * AgentPoolType represents types of an agent pool. Possible values include: + * 'VirtualMachineScaleSets', 'AvailabilitySet' + */ + type?: string; + /** + * Version of orchestrator specified when creating the managed cluster. + */ + orchestratorVersion?: string; + /** + * The current deployment or provisioning state, which only appears in the response. + */ + readonly provisioningState?: string; +} + /** * Profile for the container service agent pool. */ -export interface ManagedClusterAgentPoolProfile { +export interface ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { /** * Unique name of the agent pool profile in the context of the subscription and resource group. */ name: string; +} + +/** + * Agent Pool. + */ +export interface AgentPool extends SubResource { /** * Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to * 100 (inclusive). The default value is 1. @@ -761,7 +882,15 @@ export interface ManagedClusterAgentPoolProfile { * AgentPoolType represents types of an agent pool. Possible values include: * 'VirtualMachineScaleSets', 'AvailabilitySet' */ - type?: string; + agentPoolType?: string; + /** + * Version of orchestrator specified when creating the managed cluster. + */ + orchestratorVersion?: string; + /** + * The current deployment or provisioning state, which only appears in the response. + */ + readonly provisioningState?: string; } /** @@ -1066,3 +1195,13 @@ export interface ManagedClusterListResult extends Array { */ readonly nextLink?: string; } + +/** + * The response from the List Agent Pools operation. + */ +export interface AgentPoolListResult extends Array { + /** + * The URL to get the next set of agent pool results. + */ + readonly nextLink?: string; +} diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index 9bf8a31aa1..de9db21a2a 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -44,8 +44,11 @@ exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); exports.ContainerService = require('./containerService'); exports.OperationValue = require('./operationValue'); +exports.SubResource = require('./subResource'); exports.ManagedClusterServicePrincipalProfile = require('./managedClusterServicePrincipalProfile'); +exports.ManagedClusterAgentPoolProfileProperties = require('./managedClusterAgentPoolProfileProperties'); exports.ManagedClusterAgentPoolProfile = require('./managedClusterAgentPoolProfile'); +exports.AgentPool = require('./agentPool'); exports.ContainerServiceNetworkProfile = require('./containerServiceNetworkProfile'); exports.ManagedClusterAddonProfile = require('./managedClusterAddonProfile'); exports.ManagedClusterAADProfile = require('./managedClusterAADProfile'); @@ -62,6 +65,7 @@ exports.OpenShiftManagedClusterListResult = require('./openShiftManagedClusterLi exports.ContainerServiceListResult = require('./containerServiceListResult'); exports.OperationListResult = require('./operationListResult'); exports.ManagedClusterListResult = require('./managedClusterListResult'); +exports.AgentPoolListResult = require('./agentPoolListResult'); exports.discriminators = { 'OpenShiftManagedClusterBaseIdentityProvider' : exports.OpenShiftManagedClusterBaseIdentityProvider, 'OpenShiftManagedClusterBaseIdentityProvider.AADIdentityProvider' : exports.OpenShiftManagedClusterAADIdentityProvider diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js index a2c20f3373..ca55d23148 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js @@ -10,87 +10,21 @@ 'use strict'; +const models = require('./index'); + /** * Profile for the container service agent pool. * + * @extends models['ManagedClusterAgentPoolProfileProperties'] */ -class ManagedClusterAgentPoolProfile { +class ManagedClusterAgentPoolProfile extends models['ManagedClusterAgentPoolProfileProperties'] { /** * Create a ManagedClusterAgentPoolProfile. * @property {string} name Unique name of the agent pool profile in the * context of the subscription and resource group. - * @property {number} count Number of agents (VMs) to host docker containers. - * Allowed values must be in the range of 1 to 100 (inclusive). The default - * value is 1. . Default value: 1 . - * @property {string} vmSize Size of agent VMs. Possible values include: - * 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', - * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', - * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', - * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', - * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', - * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', - * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', - * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', - * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', - * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', - * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', - * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', - * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', - * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', - * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', - * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', - * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', - * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', - * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', - * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', - * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', - * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', - * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', - * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', - * 'Standard_DS3', 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', - * 'Standard_DS4', 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', - * 'Standard_DS5_v2', 'Standard_DS5_v2_Promo', 'Standard_E16_v3', - * 'Standard_E16s_v3', 'Standard_E2_v3', 'Standard_E2s_v3', - * 'Standard_E32-16s_v3', 'Standard_E32-8s_v3', 'Standard_E32_v3', - * 'Standard_E32s_v3', 'Standard_E4_v3', 'Standard_E4s_v3', - * 'Standard_E64-16s_v3', 'Standard_E64-32s_v3', 'Standard_E64_v3', - * 'Standard_E64s_v3', 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', - * 'Standard_F16', 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', - * 'Standard_F2', 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', - * 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', - * 'Standard_F72s_v2', 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', - * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', - * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', - * 'Standard_GS4-4', 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', - * 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', - * 'Standard_H16r', 'Standard_H8', 'Standard_H8m', 'Standard_L16s', - * 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', - * 'Standard_M128-64ms', 'Standard_M128ms', 'Standard_M128s', - * 'Standard_M64-16ms', 'Standard_M64-32ms', 'Standard_M64ms', - * 'Standard_M64s', 'Standard_NC12', 'Standard_NC12s_v2', - * 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', - * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', - * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', - * 'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', - * 'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' - * @property {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. - * @property {string} [vnetSubnetID] VNet SubnetID specifies the VNet's - * subnet identifier. - * @property {number} [maxPods] Maximum number of pods that can run on a - * node. - * @property {string} [osType] OsType to be used to specify os type. Choose - * from Linux and Windows. Default to Linux. Possible values include: - * 'Linux', 'Windows'. Default value: 'Linux' . - * @property {number} [maxCount] Maximum number of nodes for auto-scaling - * @property {number} [minCount] Minimum number of nodes for auto-scaling - * @property {boolean} [enableAutoScaling] Whether to enable auto-scaler - * @property {string} [type] AgentPoolType represents types of an agent pool. - * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' */ constructor() { + super(); } /** @@ -107,13 +41,6 @@ class ManagedClusterAgentPoolProfile { name: 'Composite', className: 'ManagedClusterAgentPoolProfile', modelProperties: { - name: { - required: true, - serializedName: 'name', - type: { - name: 'String' - } - }, count: { required: true, serializedName: 'count', @@ -189,6 +116,28 @@ class ManagedClusterAgentPoolProfile { type: { name: 'String' } + }, + orchestratorVersion: { + required: false, + serializedName: 'orchestratorVersion', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + }, + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } } } } diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfileProperties.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfileProperties.js new file mode 100644 index 0000000000..ab310ca95e --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfileProperties.js @@ -0,0 +1,209 @@ +/* + * 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'; + +/** + * Properties for the container service agent pool profile. + * + */ +class ManagedClusterAgentPoolProfileProperties { + /** + * Create a ManagedClusterAgentPoolProfileProperties. + * @property {number} count Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @property {string} vmSize Size of agent VMs. Possible values include: + * 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', + * 'Standard_DS3', 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', + * 'Standard_DS4', 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', + * 'Standard_DS5_v2', 'Standard_DS5_v2_Promo', 'Standard_E16_v3', + * 'Standard_E16s_v3', 'Standard_E2_v3', 'Standard_E2s_v3', + * 'Standard_E32-16s_v3', 'Standard_E32-8s_v3', 'Standard_E32_v3', + * 'Standard_E32s_v3', 'Standard_E4_v3', 'Standard_E4s_v3', + * 'Standard_E64-16s_v3', 'Standard_E64-32s_v3', 'Standard_E64_v3', + * 'Standard_E64s_v3', 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', + * 'Standard_F16', 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', + * 'Standard_F2', 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', + * 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', + * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', + * 'Standard_GS4-4', 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', + * 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', + * 'Standard_H16r', 'Standard_H8', 'Standard_H8m', 'Standard_L16s', + * 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', + * 'Standard_M128-64ms', 'Standard_M128ms', 'Standard_M128s', + * 'Standard_M64-16ms', 'Standard_M64-32ms', 'Standard_M64ms', + * 'Standard_M64s', 'Standard_NC12', 'Standard_NC12s_v2', + * 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', + * 'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', + * 'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * @property {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. + * @property {string} [vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * @property {number} [maxPods] Maximum number of pods that can run on a + * node. + * @property {string} [osType] OsType to be used to specify os type. Choose + * from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows'. Default value: 'Linux' . + * @property {number} [maxCount] Maximum number of nodes for auto-scaling + * @property {number} [minCount] Minimum number of nodes for auto-scaling + * @property {boolean} [enableAutoScaling] Whether to enable auto-scaler + * @property {string} [type] AgentPoolType represents types of an agent pool. + * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + * @property {string} [orchestratorVersion] Version of orchestrator specified + * when creating the managed cluster. + * @property {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedClusterAgentPoolProfileProperties + * + * @returns {object} metadata of ManagedClusterAgentPoolProfileProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedClusterAgentPoolProfileProperties', + type: { + name: 'Composite', + className: 'ManagedClusterAgentPoolProfileProperties', + modelProperties: { + count: { + required: true, + serializedName: 'count', + defaultValue: 1, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + osDiskSizeGB: { + required: false, + serializedName: 'osDiskSizeGB', + type: { + name: 'Number' + } + }, + vnetSubnetID: { + required: false, + serializedName: 'vnetSubnetID', + type: { + name: 'String' + } + }, + maxPods: { + required: false, + serializedName: 'maxPods', + type: { + name: 'Number' + } + }, + osType: { + required: false, + serializedName: 'osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + }, + maxCount: { + required: false, + serializedName: 'maxCount', + type: { + name: 'Number' + } + }, + minCount: { + required: false, + serializedName: 'minCount', + type: { + name: 'Number' + } + }, + enableAutoScaling: { + required: false, + serializedName: 'enableAutoScaling', + type: { + name: 'Boolean' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + orchestratorVersion: { + required: false, + serializedName: 'orchestratorVersion', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedClusterAgentPoolProfileProperties; diff --git a/lib/services/containerservicesManagement/lib/models/subResource.js b/lib/services/containerservicesManagement/lib/models/subResource.js new file mode 100644 index 0000000000..482c8454bc --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/subResource.js @@ -0,0 +1,76 @@ +/* + * 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'); + +/** + * Reference to another subresource. + * + * @extends models['BaseResource'] + */ +class SubResource extends models['BaseResource'] { + /** + * Create a SubResource. + * @property {string} [id] Resource ID. + * @property {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * @property {string} [type] Resource type + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SubResource + * + * @returns {object} metadata of SubResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SubResource', + type: { + name: 'Composite', + className: 'SubResource', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SubResource; diff --git a/lib/services/containerservicesManagement/lib/operations/agentPools.js b/lib/services/containerservicesManagement/lib/operations/agentPools.js new file mode 100644 index 0000000000..2624f00bb3 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/operations/agentPools.js @@ -0,0 +1,2138 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName 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 AgentPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(resourceGroupName, managedClusterName, 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 = '2019-02-01'; + // 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (managedClusterName === null || managedClusterName === undefined || typeof managedClusterName.valueOf() !== 'string') { + throw new Error('managedClusterName 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/{managedClusterName}/agentPools'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedClusterName}', encodeURIComponent(managedClusterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AgentPoolListResult']().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 the agent pool. + * + * Gets the details of the agent pool by managed cluster and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @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 AgentPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, managedClusterName, agentPoolName, 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 = '2019-02-01'; + // 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (managedClusterName === null || managedClusterName === undefined || typeof managedClusterName.valueOf() !== 'string') { + throw new Error('managedClusterName cannot be null or undefined and it must be of type string.'); + } + if (agentPoolName === null || agentPoolName === undefined || typeof agentPoolName.valueOf() !== 'string') { + throw new Error('agentPoolName 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/{managedClusterName}/agentPools/{agentPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedClusterName}', encodeURIComponent(managedClusterName)); + requestUrl = requestUrl.replace('{agentPoolName}', encodeURIComponent(agentPoolName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AgentPool']().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 Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 AgentPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, managedClusterName, agentPoolName, 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['AgentPool']().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 an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 AgentPool} 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, managedClusterName, agentPoolName, 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 = '2019-02-01'; + // 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (managedClusterName === null || managedClusterName === undefined || typeof managedClusterName.valueOf() !== 'string') { + throw new Error('managedClusterName cannot be null or undefined and it must be of type string.'); + } + if (agentPoolName === null || agentPoolName === undefined || typeof agentPoolName.valueOf() !== 'string') { + throw new Error('agentPoolName 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/{managedClusterName}/agentPools/{agentPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedClusterName}', encodeURIComponent(managedClusterName)); + requestUrl = requestUrl.replace('{agentPoolName}', encodeURIComponent(agentPoolName)); + 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['AgentPool']().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['AgentPool']().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['AgentPool']().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 Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, 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 = '2019-02-01'; + // 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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (managedClusterName === null || managedClusterName === undefined || typeof managedClusterName.valueOf() !== 'string') { + throw new Error('managedClusterName cannot be null or undefined and it must be of type string.'); + } + if (agentPoolName === null || agentPoolName === undefined || typeof agentPoolName.valueOf() !== 'string') { + throw new Error('agentPoolName 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/{managedClusterName}/agentPools/{agentPoolName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{managedClusterName}', encodeURIComponent(managedClusterName)); + requestUrl = requestUrl.replace('{agentPoolName}', encodeURIComponent(agentPoolName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AgentPoolListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a AgentPools. */ +class AgentPools { + /** + * Create a AgentPools. + * @param {ContainerServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + } + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName 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. + */ + listWithHttpOperationResponse(resourceGroupName, managedClusterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, managedClusterName, 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 a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName 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 {AgentPoolListResult} - 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 AgentPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, managedClusterName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, managedClusterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, managedClusterName, options, optionalCallback); + } + } + + /** + * @summary Gets the agent pool. + * + * Gets the details of the agent pool by managed cluster and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, managedClusterName, agentPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedClusterName, agentPoolName, 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 the agent pool. + * + * Gets the details of the agent pool by managed cluster and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @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 {AgentPool} - 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 AgentPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, managedClusterName, agentPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, managedClusterName, agentPoolName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedClusterName, agentPoolName, 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 Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 {AgentPool} - 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 AgentPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, managedClusterName, agentPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, managedClusterName, agentPoolName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedClusterName, agentPoolName, 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 Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 {AgentPool} - 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 AgentPool} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, managedClusterName, agentPoolName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, managedClusterName, agentPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, managedClusterName, agentPoolName, options, optionalCallback); + } + } + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {AgentPoolListResult} - 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 AgentPoolListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AgentPools; diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index a519f3e4eb..5f39af9595 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -4136,3 +4136,829 @@ export interface ManagedClusters { listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * AgentPools + * __NOTE__: An instance of this class is automatically created for an + * instance of the ContainerServiceClient. + */ +export interface AgentPools { + + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName 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. + */ + listWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName 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 {AgentPoolListResult} - 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. + * + * {AgentPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPoolListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName: string, managedClusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, managedClusterName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, managedClusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the agent pool. + * + * Gets the details of the agent pool by managed cluster and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the agent pool. + * + * Gets the details of the agent pool by managed cluster and resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @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 {AgentPool} - 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. + * + * {AgentPool} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPool} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 {AgentPool} - 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. + * + * {AgentPool} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPool} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates an agent pool. + * + * Creates or updates an agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * agent pool operation. + * + * @param {number} parameters.count Number of agents (VMs) to host docker + * containers. Allowed values must be in the range of 1 to 100 (inclusive). The + * default value is 1. + * + * @param {string} parameters.vmSize Size of agent VMs. Possible values + * include: 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', 'Standard_DS3', + * 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', 'Standard_DS4', + * 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', 'Standard_DS5_v2', + * 'Standard_DS5_v2_Promo', 'Standard_E16_v3', 'Standard_E16s_v3', + * 'Standard_E2_v3', 'Standard_E2s_v3', 'Standard_E32-16s_v3', + * 'Standard_E32-8s_v3', 'Standard_E32_v3', 'Standard_E32s_v3', + * 'Standard_E4_v3', 'Standard_E4s_v3', 'Standard_E64-16s_v3', + * 'Standard_E64-32s_v3', 'Standard_E64_v3', 'Standard_E64s_v3', + * 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', 'Standard_F16', + * 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', 'Standard_F2', + * 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', 'Standard_F4', + * 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', + * 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', 'Standard_G1', + * 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', 'Standard_GS1', + * 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', 'Standard_GS4-4', + * 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', 'Standard_GS5-8', + * 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', 'Standard_H16r', + * 'Standard_H8', 'Standard_H8m', 'Standard_L16s', 'Standard_L32s', + * 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', 'Standard_M128-64ms', + * 'Standard_M128ms', 'Standard_M128s', 'Standard_M64-16ms', + * 'Standard_M64-32ms', 'Standard_M64ms', 'Standard_M64s', 'Standard_NC12', + * 'Standard_NC12s_v2', 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', 'Standard_NC6s_v3', + * 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', 'Standard_ND6s', + * 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * + * @param {number} [parameters.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. + * + * @param {string} [parameters.vnetSubnetID] VNet SubnetID specifies the VNet's + * subnet identifier. + * + * @param {number} [parameters.maxPods] Maximum number of pods that can run on + * a node. + * + * @param {string} [parameters.osType] OsType to be used to specify os type. + * Choose from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows' + * + * @param {number} [parameters.maxCount] Maximum number of nodes for + * auto-scaling + * + * @param {number} [parameters.minCount] Minimum number of nodes for + * auto-scaling + * + * @param {boolean} [parameters.enableAutoScaling] Whether to enable + * auto-scaler + * + * @param {string} [parameters.agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + * + * @param {string} [parameters.orchestratorVersion] Version of orchestrator + * specified when creating the managed cluster. + * + * @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 {AgentPool} - 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. + * + * {AgentPool} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPool} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: models.AgentPool, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes an agent pool. + * + * Deletes the agent pool in the specified managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} managedClusterName The name of the managed cluster resource. + * + * @param {string} agentPoolName The name of the agent pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of agent pools in the specified managed cluster. + * + * Gets a list of agent pools in the specified managed cluster. The operation + * returns properties of each agent pool. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {AgentPoolListResult} - 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. + * + * {AgentPoolListResult} [result] - The deserialized result object if an error did not occur. + * See {@link AgentPoolListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/containerservicesManagement/lib/operations/index.js b/lib/services/containerservicesManagement/lib/operations/index.js index dda2cf2c5c..64af1c2b63 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.js +++ b/lib/services/containerservicesManagement/lib/operations/index.js @@ -18,3 +18,4 @@ exports.OpenShiftManagedClusters = require('./openShiftManagedClusters'); exports.ContainerServices = require('./containerServices'); exports.Operations = require('./operations'); exports.ManagedClusters = require('./managedClusters'); +exports.AgentPools = require('./agentPools'); diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index aebc51930a..490828e6ce 100644 --- a/lib/services/containerservicesManagement/lib/operations/managedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/managedClusters.js @@ -49,7 +49,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -187,7 +187,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -336,7 +336,7 @@ function _getUpgradeProfile(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -492,7 +492,7 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -648,7 +648,7 @@ function _listClusterAdminCredentials(resourceGroupName, resourceName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -800,7 +800,7 @@ function _listClusterUserCredentials(resourceGroupName, resourceName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -952,7 +952,7 @@ function _get(resourceGroupName, resourceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1657,7 +1657,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1847,7 +1847,7 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2014,7 +2014,7 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2155,7 +2155,7 @@ function _beginResetServicePrincipalProfile(resourceGroupName, resourceName, par if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -2319,7 +2319,7 @@ function _beginResetAADProfile(resourceGroupName, resourceName, parameters, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { diff --git a/lib/services/containerservicesManagement/lib/operations/operations.js b/lib/services/containerservicesManagement/lib/operations/operations.js index 8cf8e3a30d..b8ba843766 100644 --- a/lib/services/containerservicesManagement/lib/operations/operations.js +++ b/lib/services/containerservicesManagement/lib/operations/operations.js @@ -45,7 +45,7 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-08-01-preview'; + let apiVersion = '2019-02-01'; // Validate try { if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {