From 6c560578e0bf57a128e47edfc2e619e91e9e4755 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 31 May 2018 21:08:30 -0700 Subject: [PATCH] [AutoPR containerservices/resource-manager] [AKS] add new 2018-03-31 API (#2910) * Generated from 069fe698d58709694ea1945b032523b01a5aa4cd Rename an example file to start with a capital letter * Generated from e365e10741ba688b8c3b39b67986e2b6e06e4ddc Rename to ManagedClusterAgentPoolProfile. Its fields have diverged from ContainerServiceAgentPoolProfile. * Generated from d61dfda40f6a7498040fee441c1b23cb6a1bc01a Incorporated review comments --- .../lib/containerServiceClient.d.ts | 1 + .../lib/containerServiceClient.js | 1 + .../lib/models/computeOperationListResult.js | 60 ++ .../lib/models/computeOperationValue.js | 99 +++ .../lib/models/containerService.js | 4 +- .../containerServiceAgentPoolProfile.js | 3 +- .../models/containerServiceMasterProfile.js | 3 +- .../models/containerServiceNetworkProfile.js | 119 ++++ .../lib/models/index.d.ts | 243 +++++++- .../lib/models/index.js | 6 + .../lib/models/managedCluster.js | 88 ++- .../lib/models/managedClusterAADProfile.js | 77 +++ .../lib/models/managedClusterAddonProfile.js | 67 ++ .../models/managedClusterAgentPoolProfile.js | 213 +++++++ .../lib/operations/containerServices.js | 24 +- .../lib/operations/index.d.ts | 359 ++++++++--- .../lib/operations/index.js | 1 + .../lib/operations/managedClusters.js | 583 +++++++++--------- .../lib/operations/operations.js | 237 +++++++ 19 files changed, 1772 insertions(+), 416 deletions(-) create mode 100644 lib/services/containerservicesManagement/lib/models/computeOperationListResult.js create mode 100644 lib/services/containerservicesManagement/lib/models/computeOperationValue.js create mode 100644 lib/services/containerservicesManagement/lib/models/containerServiceNetworkProfile.js create mode 100644 lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js create mode 100644 lib/services/containerservicesManagement/lib/models/managedClusterAddonProfile.js create mode 100644 lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js create mode 100644 lib/services/containerservicesManagement/lib/operations/operations.js diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts index c5c41d3641..1d29044a2b 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts @@ -55,6 +55,7 @@ export default class ContainerServiceClient extends AzureServiceClient { // Operation groups containerServices: operations.ContainerServices; + operations: operations.Operations; managedClusters: operations.ManagedClusters; } diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.js b/lib/services/containerservicesManagement/lib/containerServiceClient.js index f3c81eea33..2651cd78d9 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.js +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.js @@ -72,6 +72,7 @@ class ContainerServiceClient extends ServiceClient { this.generateClientRequestId = options.generateClientRequestId; } this.containerServices = new operations.ContainerServices(this); + this.operations = new operations.Operations(this); this.managedClusters = new operations.ManagedClusters(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js b/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js new file mode 100644 index 0000000000..fcbd0421cb --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/computeOperationListResult.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The List Compute Operation operation response. + */ +class ComputeOperationListResult extends Array { + /** + * Create a ComputeOperationListResult. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ComputeOperationListResult + * + * @returns {object} metadata of ComputeOperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationListResult', + type: { + name: 'Composite', + className: 'ComputeOperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ComputeOperationValueElementType', + type: { + name: 'Composite', + className: 'ComputeOperationValue' + } + } + } + } + } + } + }; + } +} + +module.exports = ComputeOperationListResult; diff --git a/lib/services/containerservicesManagement/lib/models/computeOperationValue.js b/lib/services/containerservicesManagement/lib/models/computeOperationValue.js new file mode 100644 index 0000000000..bb1f964dad --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/computeOperationValue.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the properties of a Compute Operation value. + * + */ +class ComputeOperationValue { + /** + * Create a ComputeOperationValue. + * @member {string} [origin] The origin of the compute operation. + * @member {string} [name] The name of the compute operation. + * @member {string} [operation] The display name of the compute operation. + * @member {string} [resource] The display name of the resource the operation + * applies to. + * @member {string} [description] The description of the operation. + * @member {string} [provider] The resource provider for the operation. + */ + constructor() { + } + + /** + * Defines the metadata of ComputeOperationValue + * + * @returns {object} metadata of ComputeOperationValue + * + */ + mapper() { + return { + required: false, + serializedName: 'ComputeOperationValue', + type: { + name: 'Composite', + className: 'ComputeOperationValue', + modelProperties: { + origin: { + required: false, + readOnly: true, + serializedName: 'origin', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'display.operation', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'display.resource', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'display.description', + type: { + name: 'String' + } + }, + provider: { + required: false, + readOnly: true, + serializedName: 'display.provider', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ComputeOperationValue; diff --git a/lib/services/containerservicesManagement/lib/models/containerService.js b/lib/services/containerservicesManagement/lib/models/containerService.js index 2b3d9c1f3d..e99cae0d19 100644 --- a/lib/services/containerservicesManagement/lib/models/containerService.js +++ b/lib/services/containerservicesManagement/lib/models/containerService.js @@ -112,9 +112,7 @@ class ContainerService extends models['Resource'] { * If you specify 0, it will apply the default osDisk size according to the * vmSize specified. * @member {string} [masterProfile.vnetSubnetID] VNet SubnetID specifies the - * vnet's subnet identifier. If you specify either master VNet Subnet, or - * agent VNet Subnet, you need to specify both. And they have to be in the - * same VNet. + * vnet's subnet identifier. * @member {string} [masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. * @member {string} [masterProfile.storageProfile] Storage profile specifies diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js index 28713d844b..daa8d2e826 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js @@ -88,8 +88,7 @@ class ContainerServiceAgentPoolProfile { * we will choose for you based on the orchestrator choice. Possible values * include: 'StorageAccount', 'ManagedDisks' * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet - * identifier. If you specify either master VNet Subnet, or agent VNet - * Subnet, you need to specify both. And they have to be in the same VNet. + * identifier. * @member {string} [osType] OsType to be used to specify os type. Choose * from Linux and Windows. Default to Linux. Possible values include: * 'Linux', 'Windows'. Default value: 'Linux' . diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js index 11cd56d533..0b3f70e99b 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js @@ -78,8 +78,7 @@ class ContainerServiceMasterProfile { * 0, it will apply the default osDisk size according to the vmSize * specified. * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet - * identifier. If you specify either master VNet Subnet, or agent VNet - * Subnet, you need to specify both. And they have to be in the same VNet. + * identifier. * @member {string} [firstConsecutiveStaticIP] FirstConsecutiveStaticIP used * to specify the first static ip of masters. Default value: '10.240.255.5' . * @member {string} [storageProfile] Storage profile specifies what kind of diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceNetworkProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceNetworkProfile.js new file mode 100644 index 0000000000..012cd20df4 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/containerServiceNetworkProfile.js @@ -0,0 +1,119 @@ +/* + * 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'; + +/** + * Profile of network configuration. + * + */ +class ContainerServiceNetworkProfile { + /** + * Create a ContainerServiceNetworkProfile. + * @member {string} [networkPlugin] Network plugin used for building + * Kubernetes network. Possible values include: 'azure', 'kubenet'. Default + * value: 'kubenet' . + * @member {string} [networkPolicy] Network policy used for building + * Kubernetes network. Possible values include: 'calico' + * @member {string} [podCidr] A CIDR notation IP range from which to assign + * pod IPs when kubenet is used. Default value: '10.244.0.0/16' . + * @member {string} [serviceCidr] A CIDR notation IP range from which to + * assign service cluster IPs. It must not overlap with any Subnet IP ranges. + * Default value: '10.0.0.0/16' . + * @member {string} [dnsServiceIP] An IP address assigned to the Kubernetes + * DNS service. It must be within the Kubernetes service address range + * specified in serviceCidr. Default value: '10.0.0.10' . + * @member {string} [dockerBridgeCidr] A CIDR notation IP range assigned to + * the Docker bridge network. It must not overlap with any Subnet IP ranges + * or the Kubernetes service address range. Default value: '172.17.0.1/16' . + */ + constructor() { + } + + /** + * Defines the metadata of ContainerServiceNetworkProfile + * + * @returns {object} metadata of ContainerServiceNetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ContainerServiceNetworkProfile', + type: { + name: 'Composite', + className: 'ContainerServiceNetworkProfile', + modelProperties: { + networkPlugin: { + required: false, + serializedName: 'networkPlugin', + defaultValue: 'kubenet', + type: { + name: 'String' + } + }, + networkPolicy: { + required: false, + serializedName: 'networkPolicy', + type: { + name: 'String' + } + }, + podCidr: { + required: false, + serializedName: 'podCidr', + defaultValue: '10.244.0.0/16', + constraints: { + Pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$' + }, + type: { + name: 'String' + } + }, + serviceCidr: { + required: false, + serializedName: 'serviceCidr', + defaultValue: '10.0.0.0/16', + constraints: { + Pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$' + }, + type: { + name: 'String' + } + }, + dnsServiceIP: { + required: false, + serializedName: 'dnsServiceIP', + defaultValue: '10.0.0.10', + constraints: { + Pattern: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$' + }, + type: { + name: 'String' + } + }, + dockerBridgeCidr: { + required: false, + serializedName: 'dockerBridgeCidr', + defaultValue: '172.17.0.1/16', + constraints: { + Pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$' + }, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContainerServiceNetworkProfile; diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 5ed132953e..1b99cea0d1 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -171,8 +171,7 @@ export interface ContainerServiceOrchestratorProfile { * disk size for every machine in this master/agent pool. If you specify 0, it * will apply the default osDisk size according to the vmSize specified. * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet - * identifier. If you specify either master VNet Subnet, or agent VNet Subnet, - * you need to specify both. And they have to be in the same VNet. + * identifier. * @member {string} [firstConsecutiveStaticIP] FirstConsecutiveStaticIP used to * specify the first static ip of masters. Default value: '10.240.255.5' . * @member {string} [storageProfile] Storage profile specifies what kind of @@ -267,8 +266,7 @@ export interface ContainerServiceMasterProfile { * we will choose for you based on the orchestrator choice. Possible values * include: 'StorageAccount', 'ManagedDisks' * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet - * identifier. If you specify either master VNet Subnet, or agent VNet Subnet, - * you need to specify both. And they have to be in the same VNet. + * identifier. * @member {string} [osType] OsType to be used to specify os type. Choose from * Linux and Windows. Default to Linux. Possible values include: 'Linux', * 'Windows'. Default value: 'Linux' . @@ -476,8 +474,7 @@ export interface ContainerServiceDiagnosticsProfile { * specify 0, it will apply the default osDisk size according to the vmSize * specified. * @member {string} [masterProfile.vnetSubnetID] VNet SubnetID specifies the - * vnet's subnet identifier. If you specify either master VNet Subnet, or agent - * VNet Subnet, you need to specify both. And they have to be in the same VNet. + * vnet's subnet identifier. * @member {string} [masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. * @member {string} [masterProfile.storageProfile] Storage profile specifies @@ -521,6 +518,190 @@ export interface ContainerService extends Resource { diagnosticsProfile?: ContainerServiceDiagnosticsProfile; } +/** + * @class + * Initializes a new instance of the ComputeOperationValue class. + * @constructor + * Describes the properties of a Compute Operation value. + * + * @member {string} [origin] The origin of the compute operation. + * @member {string} [name] The name of the compute operation. + * @member {string} [operation] The display name of the compute operation. + * @member {string} [resource] The display name of the resource the operation + * applies to. + * @member {string} [description] The description of the operation. + * @member {string} [provider] The resource provider for the operation. + */ +export interface ComputeOperationValue { + readonly origin?: string; + readonly name?: string; + readonly operation?: string; + readonly resource?: string; + readonly description?: string; + readonly provider?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedClusterAgentPoolProfile class. + * @constructor + * Profile for the container service agent pool. + * + * @member {string} name Unique name of the agent pool profile in the context + * of the subscription and resource group. + * @member {number} [count] Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * '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' + * @member {number} [osDiskSizeGB] OS Disk Size in GB to be used to specify the + * disk size for every machine in this master/agent pool. If you specify 0, it + * will apply the default osDisk size according to the vmSize specified. + * @member {string} [dnsPrefix] DNS prefix to be used to create the FQDN for + * the agent pool. + * @member {string} [fqdn] FDQN for the agent pool. + * @member {array} [ports] Ports number array used to expose on this agent + * pool. The default opened ports are different based on your choice of + * orchestrator. + * @member {string} [storageProfile] Storage profile specifies what kind of + * storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, + * we will choose for you based on the orchestrator choice. Possible values + * include: 'StorageAccount', 'ManagedDisks' + * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * identifier. + * @member {number} [maxPods] Maximum number of pods that can run on a node. + * Default value: 30 . + * @member {string} [osType] OsType to be used to specify os type. Choose from + * Linux and Windows. Default to Linux. Possible values include: 'Linux', + * 'Windows'. Default value: 'Linux' . + */ +export interface ManagedClusterAgentPoolProfile { + name: string; + count?: number; + vmSize: string; + osDiskSizeGB?: number; + dnsPrefix?: string; + readonly fqdn?: string; + ports?: number[]; + storageProfile?: string; + vnetSubnetID?: string; + maxPods?: number; + osType?: string; +} + +/** + * @class + * Initializes a new instance of the ContainerServiceNetworkProfile class. + * @constructor + * Profile of network configuration. + * + * @member {string} [networkPlugin] Network plugin used for building Kubernetes + * network. Possible values include: 'azure', 'kubenet'. Default value: + * 'kubenet' . + * @member {string} [networkPolicy] Network policy used for building Kubernetes + * network. Possible values include: 'calico' + * @member {string} [podCidr] A CIDR notation IP range from which to assign pod + * IPs when kubenet is used. Default value: '10.244.0.0/16' . + * @member {string} [serviceCidr] A CIDR notation IP range from which to assign + * service cluster IPs. It must not overlap with any Subnet IP ranges. Default + * value: '10.0.0.0/16' . + * @member {string} [dnsServiceIP] An IP address assigned to the Kubernetes DNS + * service. It must be within the Kubernetes service address range specified in + * serviceCidr. Default value: '10.0.0.10' . + * @member {string} [dockerBridgeCidr] A CIDR notation IP range assigned to the + * Docker bridge network. It must not overlap with any Subnet IP ranges or the + * Kubernetes service address range. Default value: '172.17.0.1/16' . + */ +export interface ContainerServiceNetworkProfile { + networkPlugin?: string; + networkPolicy?: string; + podCidr?: string; + serviceCidr?: string; + dnsServiceIP?: string; + dockerBridgeCidr?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedClusterAddonProfile class. + * @constructor + * A Kubernetes add-on profile for a managed cluster. + * + * @member {boolean} enabled Whether the add-on is enabled or not. + * @member {object} [config] Key-value pairs for configuring an add-on. + */ +export interface ManagedClusterAddonProfile { + enabled: boolean; + config?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the ManagedClusterAADProfile class. + * @constructor + * AADProfile specifies attributes for Azure Active Directory integration. + * + * @member {string} clientAppID The client AAD application ID. + * @member {string} serverAppID The server AAD application ID. + * @member {string} serverAppSecret The server AAD application secret. + * @member {string} [tenantID] The AAD tenant ID to use for authentication. If + * not specified, will use the tenant of the deployment subscription. + */ +export interface ManagedClusterAADProfile { + clientAppID: string; + serverAppID: string; + serverAppSecret: string; + tenantID?: string; +} + /** * @class * Initializes a new instance of the ManagedCluster class. @@ -529,11 +710,11 @@ export interface ContainerService extends Resource { * * @member {string} [provisioningState] The current deployment or provisioning * state, which only appears in the response. + * @member {string} [kubernetesVersion] Version of Kubernetes specified when + * creating the managed cluster. * @member {string} [dnsPrefix] DNS prefix specified when creating the managed * cluster. * @member {string} [fqdn] FDQN for the master pool. - * @member {string} [kubernetesVersion] Version of Kubernetes specified when - * creating the managed cluster. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. @@ -558,15 +739,47 @@ export interface ContainerService extends Resource { * secret name. * @member {string} [servicePrincipalProfile.keyVaultSecretRef.version] The * secret version. + * @member {object} [addonProfiles] Profile of managed cluster add-on. + * @member {boolean} [enableRBAC] Whether to enable Kubernetes Role-Based + * Access Control. + * @member {object} [networkProfile] Profile of network configuration. + * @member {string} [networkProfile.networkPlugin] Network plugin used for + * building Kubernetes network. Possible values include: 'azure', 'kubenet' + * @member {string} [networkProfile.networkPolicy] Network policy used for + * building Kubernetes network. Possible values include: 'calico' + * @member {string} [networkProfile.podCidr] A CIDR notation IP range from + * which to assign pod IPs when kubenet is used. + * @member {string} [networkProfile.serviceCidr] A CIDR notation IP range from + * which to assign service cluster IPs. It must not overlap with any Subnet IP + * ranges. + * @member {string} [networkProfile.dnsServiceIP] An IP address assigned to the + * Kubernetes DNS service. It must be within the Kubernetes service address + * range specified in serviceCidr. + * @member {string} [networkProfile.dockerBridgeCidr] A CIDR notation IP range + * assigned to the Docker bridge network. It must not overlap with any Subnet + * IP ranges or the Kubernetes service address range. + * @member {object} [aadProfile] Profile of Azure Active Directory + * configuration. + * @member {string} [aadProfile.clientAppID] The client AAD application ID. + * @member {string} [aadProfile.serverAppID] The server AAD application ID. + * @member {string} [aadProfile.serverAppSecret] The server AAD application + * secret. + * @member {string} [aadProfile.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. */ export interface ManagedCluster extends Resource { readonly provisioningState?: string; + kubernetesVersion?: string; dnsPrefix?: string; readonly fqdn?: string; - kubernetesVersion?: string; - agentPoolProfiles?: ContainerServiceAgentPoolProfile[]; + agentPoolProfiles?: ManagedClusterAgentPoolProfile[]; linuxProfile?: ContainerServiceLinuxProfile; servicePrincipalProfile?: ContainerServiceServicePrincipalProfile; + addonProfiles?: { [propertyName: string]: ManagedClusterAddonProfile }; + enableRBAC?: boolean; + networkProfile?: ContainerServiceNetworkProfile; + aadProfile?: ManagedClusterAADProfile; } /** @@ -700,6 +913,16 @@ export interface ContainerServiceListResult extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the ComputeOperationListResult class. + * @constructor + * The List Compute Operation operation response. + * + */ +export interface ComputeOperationListResult extends Array { +} + /** * @class * Initializes a new instance of the ManagedClusterListResult class. diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index ea6dcb849a..fff4de6b54 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -32,6 +32,11 @@ exports.ContainerServiceLinuxProfile = require('./containerServiceLinuxProfile') exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics'); exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); exports.ContainerService = require('./containerService'); +exports.ComputeOperationValue = require('./computeOperationValue'); +exports.ManagedClusterAgentPoolProfile = require('./managedClusterAgentPoolProfile'); +exports.ContainerServiceNetworkProfile = require('./containerServiceNetworkProfile'); +exports.ManagedClusterAddonProfile = require('./managedClusterAddonProfile'); +exports.ManagedClusterAADProfile = require('./managedClusterAADProfile'); exports.ManagedCluster = require('./managedCluster'); exports.OrchestratorProfile = require('./orchestratorProfile'); exports.ManagedClusterAccessProfile = require('./managedClusterAccessProfile'); @@ -40,4 +45,5 @@ exports.ManagedClusterUpgradeProfile = require('./managedClusterUpgradeProfile') exports.OrchestratorVersionProfile = require('./orchestratorVersionProfile'); exports.OrchestratorVersionProfileListResult = require('./orchestratorVersionProfileListResult'); exports.ContainerServiceListResult = require('./containerServiceListResult'); +exports.ComputeOperationListResult = require('./computeOperationListResult'); exports.ManagedClusterListResult = require('./managedClusterListResult'); diff --git a/lib/services/containerservicesManagement/lib/models/managedCluster.js b/lib/services/containerservicesManagement/lib/models/managedCluster.js index 0f803c723c..5f36c2d456 100644 --- a/lib/services/containerservicesManagement/lib/models/managedCluster.js +++ b/lib/services/containerservicesManagement/lib/models/managedCluster.js @@ -22,11 +22,11 @@ class ManagedCluster extends models['Resource'] { * Create a ManagedCluster. * @member {string} [provisioningState] The current deployment or * provisioning state, which only appears in the response. + * @member {string} [kubernetesVersion] Version of Kubernetes specified when + * creating the managed cluster. * @member {string} [dnsPrefix] DNS prefix specified when creating the * managed cluster. * @member {string} [fqdn] FDQN for the master pool. - * @member {string} [kubernetesVersion] Version of Kubernetes specified when - * creating the managed cluster. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. @@ -51,6 +51,34 @@ class ManagedCluster extends models['Resource'] { * The secret name. * @member {string} [servicePrincipalProfile.keyVaultSecretRef.version] The * secret version. + * @member {object} [addonProfiles] Profile of managed cluster add-on. + * @member {boolean} [enableRBAC] Whether to enable Kubernetes Role-Based + * Access Control. + * @member {object} [networkProfile] Profile of network configuration. + * @member {string} [networkProfile.networkPlugin] Network plugin used for + * building Kubernetes network. Possible values include: 'azure', 'kubenet' + * @member {string} [networkProfile.networkPolicy] Network policy used for + * building Kubernetes network. Possible values include: 'calico' + * @member {string} [networkProfile.podCidr] A CIDR notation IP range from + * which to assign pod IPs when kubenet is used. + * @member {string} [networkProfile.serviceCidr] A CIDR notation IP range + * from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * @member {string} [networkProfile.dnsServiceIP] An IP address assigned to + * the Kubernetes DNS service. It must be within the Kubernetes service + * address range specified in serviceCidr. + * @member {string} [networkProfile.dockerBridgeCidr] A CIDR notation IP + * range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * @member {object} [aadProfile] Profile of Azure Active Directory + * configuration. + * @member {string} [aadProfile.clientAppID] The client AAD application ID. + * @member {string} [aadProfile.serverAppID] The server AAD application ID. + * @member {string} [aadProfile.serverAppSecret] The server AAD application + * secret. + * @member {string} [aadProfile.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. */ constructor() { super(); @@ -123,24 +151,24 @@ class ManagedCluster extends models['Resource'] { name: 'String' } }, - dnsPrefix: { + kubernetesVersion: { required: false, - serializedName: 'properties.dnsPrefix', + serializedName: 'properties.kubernetesVersion', type: { name: 'String' } }, - fqdn: { + dnsPrefix: { required: false, - readOnly: true, - serializedName: 'properties.fqdn', + serializedName: 'properties.dnsPrefix', type: { name: 'String' } }, - kubernetesVersion: { + fqdn: { required: false, - serializedName: 'properties.kubernetesVersion', + readOnly: true, + serializedName: 'properties.fqdn', type: { name: 'String' } @@ -152,10 +180,10 @@ class ManagedCluster extends models['Resource'] { name: 'Sequence', element: { required: false, - serializedName: 'ContainerServiceAgentPoolProfileElementType', + serializedName: 'ManagedClusterAgentPoolProfileElementType', type: { name: 'Composite', - className: 'ContainerServiceAgentPoolProfile' + className: 'ManagedClusterAgentPoolProfile' } } } @@ -175,6 +203,44 @@ class ManagedCluster extends models['Resource'] { name: 'Composite', className: 'ContainerServiceServicePrincipalProfile' } + }, + addonProfiles: { + required: false, + serializedName: 'properties.addonProfiles', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ManagedClusterAddonProfileElementType', + type: { + name: 'Composite', + className: 'ManagedClusterAddonProfile' + } + } + } + }, + enableRBAC: { + required: false, + serializedName: 'properties.enableRBAC', + type: { + name: 'Boolean' + } + }, + networkProfile: { + required: false, + serializedName: 'properties.networkProfile', + type: { + name: 'Composite', + className: 'ContainerServiceNetworkProfile' + } + }, + aadProfile: { + required: false, + serializedName: 'properties.aadProfile', + type: { + name: 'Composite', + className: 'ManagedClusterAADProfile' + } } } } diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js new file mode 100644 index 0000000000..8f76641400 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js @@ -0,0 +1,77 @@ +/* + * 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'; + +/** + * AADProfile specifies attributes for Azure Active Directory integration. + * + */ +class ManagedClusterAADProfile { + /** + * Create a ManagedClusterAADProfile. + * @member {string} clientAppID The client AAD application ID. + * @member {string} serverAppID The server AAD application ID. + * @member {string} serverAppSecret The server AAD application secret. + * @member {string} [tenantID] The AAD tenant ID to use for authentication. + * If not specified, will use the tenant of the deployment subscription. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedClusterAADProfile + * + * @returns {object} metadata of ManagedClusterAADProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedClusterAADProfile', + type: { + name: 'Composite', + className: 'ManagedClusterAADProfile', + modelProperties: { + clientAppID: { + required: true, + serializedName: 'clientAppID', + type: { + name: 'String' + } + }, + serverAppID: { + required: true, + serializedName: 'serverAppID', + type: { + name: 'String' + } + }, + serverAppSecret: { + required: true, + serializedName: 'serverAppSecret', + type: { + name: 'String' + } + }, + tenantID: { + required: false, + serializedName: 'tenantID', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedClusterAADProfile; diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAddonProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAddonProfile.js new file mode 100644 index 0000000000..b6a406630c --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAddonProfile.js @@ -0,0 +1,67 @@ +/* + * 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'; + +/** + * A Kubernetes add-on profile for a managed cluster. + * + */ +class ManagedClusterAddonProfile { + /** + * Create a ManagedClusterAddonProfile. + * @member {boolean} enabled Whether the add-on is enabled or not. + * @member {object} [config] Key-value pairs for configuring an add-on. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedClusterAddonProfile + * + * @returns {object} metadata of ManagedClusterAddonProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedClusterAddonProfile', + type: { + name: 'Composite', + className: 'ManagedClusterAddonProfile', + modelProperties: { + enabled: { + required: true, + serializedName: 'enabled', + type: { + name: 'Boolean' + } + }, + config: { + required: false, + serializedName: 'config', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedClusterAddonProfile; diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js new file mode 100644 index 0000000000..06773301d8 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js @@ -0,0 +1,213 @@ +/* + * 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'; + +/** + * Profile for the container service agent pool. + * + */ +class ManagedClusterAgentPoolProfile { + /** + * Create a ManagedClusterAgentPoolProfile. + * @member {string} name Unique name of the agent pool profile in the context + * of the subscription and resource group. + * @member {number} [count] Number of agents (VMs) to host docker containers. + * Allowed values must be in the range of 1 to 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * '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' + * @member {number} [osDiskSizeGB] OS Disk Size in GB to be used to specify + * the disk size for every machine in this master/agent pool. If you specify + * 0, it will apply the default osDisk size according to the vmSize + * specified. + * @member {string} [dnsPrefix] DNS prefix to be used to create the FQDN for + * the agent pool. + * @member {string} [fqdn] FDQN for the agent pool. + * @member {array} [ports] Ports number array used to expose on this agent + * pool. The default opened ports are different based on your choice of + * orchestrator. + * @member {string} [storageProfile] Storage profile specifies what kind of + * storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, + * we will choose for you based on the orchestrator choice. Possible values + * include: 'StorageAccount', 'ManagedDisks' + * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * identifier. + * @member {number} [maxPods] Maximum number of pods that can run on a node. + * Default value: 30 . + * @member {string} [osType] OsType to be used to specify os type. Choose + * from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows'. Default value: 'Linux' . + */ + constructor() { + } + + /** + * Defines the metadata of ManagedClusterAgentPoolProfile + * + * @returns {object} metadata of ManagedClusterAgentPoolProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedClusterAgentPoolProfile', + type: { + name: 'Composite', + className: 'ManagedClusterAgentPoolProfile', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: false, + 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' + } + }, + dnsPrefix: { + required: false, + serializedName: 'dnsPrefix', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + readOnly: true, + serializedName: 'fqdn', + type: { + name: 'String' + } + }, + ports: { + required: false, + serializedName: 'ports', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NumberElementType', + type: { + name: 'Number' + } + } + } + }, + storageProfile: { + required: false, + serializedName: 'storageProfile', + type: { + name: 'String' + } + }, + vnetSubnetID: { + required: false, + serializedName: 'vnetSubnetID', + type: { + name: 'String' + } + }, + maxPods: { + required: false, + serializedName: 'maxPods', + defaultValue: 30, + type: { + name: 'Number' + } + }, + osType: { + required: false, + serializedName: 'osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ManagedClusterAgentPoolProfile; diff --git a/lib/services/containerservicesManagement/lib/operations/containerServices.js b/lib/services/containerservicesManagement/lib/operations/containerServices.js index 2e8833fea0..8d22b81dad 100644 --- a/lib/services/containerservicesManagement/lib/operations/containerServices.js +++ b/lib/services/containerservicesManagement/lib/operations/containerServices.js @@ -274,9 +274,7 @@ function _list(options, callback) { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1032,9 +1030,7 @@ function _listOrchestrators(location, options, callback) { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1896,9 +1892,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2094,9 +2088,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2703,9 +2695,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2901,9 +2891,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index b9cdced218..c16024e677 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -204,9 +204,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -390,9 +388,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -876,9 +872,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1062,9 +1056,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. If you specify either master VNet - * Subnet, or agent VNet Subnet, you need to specify both. And they have to be - * in the same VNet. + * specifies the vnet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1350,6 +1342,67 @@ export interface ContainerServices { listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the ContainerServiceClient. + */ +export interface Operations { + + + /** + * Gets a list of compute operations. + * + * @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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets a list of compute operations. + * + * @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 {ComputeOperationListResult} - 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. + * + * {ComputeOperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link ComputeOperationListResult} 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(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * ManagedClusters @@ -1619,76 +1672,6 @@ export interface ManagedClusters { getAccessProfile(resourceGroupName: string, resourceName: string, roleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - /** - * @summary Gets access profile of a managed cluster. - * - * Use ManagedClusters_GetAccessProfile instead. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAccessProfilesWithHttpOperationResponse(resourceGroupName: string, resourceName: string, roleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets access profile of a managed cluster. - * - * Use ManagedClusters_GetAccessProfile instead. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ManagedClusterAccessProfile} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ManagedClusterAccessProfile} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterAccessProfile} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAccessProfiles(resourceGroupName: string, resourceName: string, roleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAccessProfiles(resourceGroupName: string, resourceName: string, roleName: string, callback: ServiceCallback): void; - getAccessProfiles(resourceGroupName: string, resourceName: string, roleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets a managed cluster. * @@ -1767,12 +1750,12 @@ export interface ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -1812,6 +1795,53 @@ export interface ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1842,12 +1872,12 @@ export interface ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -1887,6 +1917,53 @@ export interface ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1998,12 +2075,12 @@ export interface ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2043,6 +2120,53 @@ export interface ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -2073,12 +2197,12 @@ export interface ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2118,6 +2242,53 @@ export interface ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags diff --git a/lib/services/containerservicesManagement/lib/operations/index.js b/lib/services/containerservicesManagement/lib/operations/index.js index 88835b10f3..da31241c46 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.js +++ b/lib/services/containerservicesManagement/lib/operations/index.js @@ -15,4 +15,5 @@ 'use strict'; exports.ContainerServices = require('./containerServices'); +exports.Operations = require('./operations'); exports.ManagedClusters = require('./managedClusters'); diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index f2b860ff21..bc88d28ea8 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 = '2017-08-31'; + let apiVersion = '2018-03-31'; // 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 = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -330,7 +330,7 @@ function _getUpgradeProfile(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -480,7 +480,7 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -592,159 +592,6 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c }); } -/** - * @summary Gets access profile of a managed cluster. - * - * Use ManagedClusters_GetAccessProfile instead. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterAccessProfile} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getAccessProfiles(resourceGroupName, resourceName, roleName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2017-08-31'; - // Validate - try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { - throw new Error('resourceName cannot be null or undefined and it must be of type string.'); - } - if (roleName === null || roleName === undefined || typeof roleName.valueOf() !== 'string') { - throw new Error('roleName cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); - requestUrl = requestUrl.replace('{roleName}', encodeURIComponent(roleName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = '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['ManagedClusterAccessProfile']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - /** * @summary Gets a managed cluster. * @@ -783,7 +630,7 @@ function _get(resourceGroupName, resourceName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -905,12 +752,12 @@ function _get(resourceGroupName, resourceName, options, callback) { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -950,6 +797,53 @@ function _get(resourceGroupName, resourceName, options, callback) { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1102,12 +996,12 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -1147,6 +1041,53 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -1179,7 +1120,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1357,7 +1298,7 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2017-08-31'; + let apiVersion = '2018-03-31'; // Validate try { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { @@ -1723,7 +1664,6 @@ class ManagedClusters { this._listByResourceGroup = _listByResourceGroup; this._getUpgradeProfile = _getUpgradeProfile; this._getAccessProfile = _getAccessProfile; - this._getAccessProfiles = _getAccessProfiles; this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; @@ -2101,103 +2041,6 @@ class ManagedClusters { } } - /** - * @summary Gets access profile of a managed cluster. - * - * Use ManagedClusters_GetAccessProfile instead. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAccessProfilesWithHttpOperationResponse(resourceGroupName, resourceName, roleName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAccessProfiles(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets access profile of a managed cluster. - * - * Use ManagedClusters_GetAccessProfile instead. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the managed cluster resource. - * - * @param {string} roleName The name of the role for managed cluster - * accessProfile resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ManagedClusterAccessProfile} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterAccessProfile} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAccessProfiles(resourceGroupName, resourceName, roleName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getAccessProfiles(resourceGroupName, resourceName, roleName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAccessProfiles(resourceGroupName, resourceName, roleName, options, optionalCallback); - } - } - /** * @summary Gets a managed cluster. * @@ -2303,12 +2146,12 @@ class ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2348,6 +2191,53 @@ class ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -2390,12 +2280,12 @@ class ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2435,6 +2325,53 @@ class ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -2588,12 +2525,12 @@ class ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2633,6 +2570,53 @@ class ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags @@ -2675,12 +2659,12 @@ class ManagedClusters { * @param {object} parameters Parameters supplied to the Create or Update a * Managed Cluster operation. * - * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating - * the managed cluster. - * * @param {string} [parameters.kubernetesVersion] Version of Kubernetes * specified when creating the managed cluster. * + * @param {string} [parameters.dnsPrefix] DNS prefix specified when creating + * the managed cluster. + * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the @@ -2720,6 +2704,53 @@ class ManagedClusters { * [parameters.servicePrincipalProfile.keyVaultSecretRef.version] The secret * version. * + * @param {object} [parameters.addonProfiles] Profile of managed cluster + * add-on. + * + * @param {boolean} [parameters.enableRBAC] Whether to enable Kubernetes + * Role-Based Access Control. + * + * @param {object} [parameters.networkProfile] Profile of network + * configuration. + * + * @param {string} [parameters.networkProfile.networkPlugin] Network plugin + * used for building Kubernetes network. Possible values include: 'azure', + * 'kubenet' + * + * @param {string} [parameters.networkProfile.networkPolicy] Network policy + * used for building Kubernetes network. Possible values include: 'calico' + * + * @param {string} [parameters.networkProfile.podCidr] A CIDR notation IP range + * from which to assign pod IPs when kubenet is used. + * + * @param {string} [parameters.networkProfile.serviceCidr] A CIDR notation IP + * range from which to assign service cluster IPs. It must not overlap with any + * Subnet IP ranges. + * + * @param {string} [parameters.networkProfile.dnsServiceIP] An IP address + * assigned to the Kubernetes DNS service. It must be within the Kubernetes + * service address range specified in serviceCidr. + * + * @param {string} [parameters.networkProfile.dockerBridgeCidr] A CIDR notation + * IP range assigned to the Docker bridge network. It must not overlap with any + * Subnet IP ranges or the Kubernetes service address range. + * + * @param {object} [parameters.aadProfile] Profile of Azure Active Directory + * configuration. + * + * @param {string} parameters.aadProfile.clientAppID The client AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppID The server AAD application + * ID. + * + * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * application secret. + * + * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {string} parameters.location Resource location * * @param {object} [parameters.tags] Resource tags diff --git a/lib/services/containerservicesManagement/lib/operations/operations.js b/lib/services/containerservicesManagement/lib/operations/operations.js new file mode 100644 index 0000000000..d45053cfd0 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/operations/operations.js @@ -0,0 +1,237 @@ +/* + * 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; + +/** + * Gets a list of compute operations. + * + * @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 ComputeOperationListResult} 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(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-03-31'; + // Validate + try { + if (this.client.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('/') ? '' : '/') + 'providers/Microsoft.ContainerService/operations'; + 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['ComputeOperationListResult']().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 Operations. */ +class Operations { + /** + * Create a Operations. + * @param {ContainerServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + } + + /** + * Gets a list of compute operations. + * + * @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(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets a list of compute operations. + * + * @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 {ComputeOperationListResult} - 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 ComputeOperationListResult} 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(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(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + +} + +module.exports = Operations;