diff --git a/lib/services/containerservicesManagement/LICENSE.txt b/lib/services/containerservicesManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/containerservicesManagement/LICENSE.txt +++ b/lib/services/containerservicesManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/containerservicesManagement/README.md b/lib/services/containerservicesManagement/README.md index 2a1bd6ba5d..819f6de5e0 100644 --- a/lib/services/containerservicesManagement/README.md +++ b/lib/services/containerservicesManagement/README.md @@ -18,7 +18,7 @@ npm install azure-arm-containerservice ## How to use -### Authentication, client creation and get openShiftManagedClusters as an example. +### Authentication, client creation and list openShiftManagedClusters as an example. ```javascript const msRestAzure = require("ms-rest-azure"); @@ -26,9 +26,7 @@ const ContainerServiceClient = require("azure-arm-containerservice"); msRestAzure.interactiveLogin().then((creds) => { const subscriptionId = ""; const client = new ContainerServiceClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const resourceName = "testresourceName"; - return client.openShiftManagedClusters.get(resourceGroupName, resourceName).then((result) => { + return client.openShiftManagedClusters.list().then((result) => { console.log("The result is:"); console.log(result); }); diff --git a/lib/services/containerservicesManagement/lib/models/containerService.js b/lib/services/containerservicesManagement/lib/models/containerService.js index e99cae0d19..aa67ad06e2 100644 --- a/lib/services/containerservicesManagement/lib/models/containerService.js +++ b/lib/services/containerservicesManagement/lib/models/containerService.js @@ -112,14 +112,14 @@ 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. + * 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 * 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} [masterProfile.fqdn] FDQN for the master pool. + * @member {string} [masterProfile.fqdn] FQDN for the master pool. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [windowsProfile] Profile for Windows VMs in the container * service cluster. diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js index daa8d2e826..4c3884235a 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceAgentPoolProfile.js @@ -79,7 +79,7 @@ class ContainerServiceAgentPoolProfile { * 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 {string} [fqdn] FQDN 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. @@ -87,7 +87,7 @@ class ContainerServiceAgentPoolProfile { * 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 + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {string} [osType] OsType to be used to specify os type. Choose * from Linux and Windows. Default to Linux. Possible values include: diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js index 0b3f70e99b..43f4b89b66 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceMasterProfile.js @@ -77,7 +77,7 @@ class ContainerServiceMasterProfile { * 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} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {string} [firstConsecutiveStaticIP] FirstConsecutiveStaticIP used * to specify the first static ip of masters. Default value: '10.240.255.5' . @@ -85,7 +85,7 @@ class ContainerServiceMasterProfile { * 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} [fqdn] FDQN for the master pool. + * @member {string} [fqdn] FQDN for the master pool. */ constructor() { } diff --git a/lib/services/containerservicesManagement/lib/models/credentialResults.js b/lib/services/containerservicesManagement/lib/models/credentialResults.js index c6c3842e35..2febe409cb 100644 --- a/lib/services/containerservicesManagement/lib/models/credentialResults.js +++ b/lib/services/containerservicesManagement/lib/models/credentialResults.js @@ -17,7 +17,8 @@ class CredentialResults { /** * Create a CredentialResults. - * @member {array} [kubeconfigs] + * @member {array} [kubeconfigs] Base64-encoded Kubernetes configuration + * file. */ constructor() { } diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index fd01ccbd07..65e6ed83f4 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -64,7 +64,7 @@ export interface PurchasePlan { * Represents an OpenShift router * * @member {string} [name] Name of the router profile. - * @member {string} [publicSubdomain] DNS subdomain for openshift router. + * @member {string} [publicSubdomain] DNS subdomain for OpenShift router. * @member {string} [fqdn] Auto-allocated FQDN for the OpenShift router. */ export interface OpenShiftRouterProfile { @@ -98,9 +98,17 @@ export interface NetworkProfile { * @member {string} [name] Unique name of the master pool profile in the * context of the subscription and resource group. * @member {number} count Number of masters (VMs) to host docker containers. - * The default value is 3. Default value: 3 . + * The default value is 3. * @member {string} vmSize Size of agent VMs. Possible values include: - * 'Standard_D2s_v3', 'Standard_D4s_v3' + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', + * 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_DS4_v2', + * 'Standard_DS5_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_F8s', + * 'Standard_F16s', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', + * 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', + * 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' * @member {string} [subnetCidr] Subnet CIDR for the peering. * @member {string} [osType] OsType to be used to specify os type. Choose from * Linux and Windows. Default to Linux. Possible values include: 'Linux', @@ -123,10 +131,16 @@ export interface OpenShiftManagedClusterMasterPoolProfile { * @member {string} name Unique name of the 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 5 (inclusive). The default value - * is 2. . Default value: 2 . * @member {string} vmSize Size of agent VMs. Possible values include: - * 'Standard_D2s_v3', 'Standard_D4s_v3' + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', 'Standard_D16s_v3', + * 'Standard_D32s_v3', 'Standard_D64s_v3', 'Standard_DS4_v2', + * 'Standard_DS5_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_F8s', + * 'Standard_F16s', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', + * 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', + * 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' * @member {string} [subnetCidr] Subnet CIDR for the peering. Default value: * '10.0.0.0/24' . * @member {string} [osType] OsType to be used to specify os type. Choose from @@ -216,7 +230,15 @@ export interface OpenShiftManagedClusterAuthProfile { * @member {number} [masterPoolProfile.count] Number of masters (VMs) to host * docker containers. The default value is 3. * @member {string} [masterPoolProfile.vmSize] Size of agent VMs. Possible - * values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * values include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', 'Standard_F16s_v2', + * 'Standard_F32s_v2', 'Standard_F64s_v2', 'Standard_F72s_v2', 'Standard_F8s', + * 'Standard_F16s', 'Standard_E4s_v3', 'Standard_E8s_v3', 'Standard_E16s_v3', + * 'Standard_E20s_v3', 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', + * 'Standard_GS3', 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', + * 'Standard_DS13_v2', 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', + * 'Standard_L8s', 'Standard_L16s', 'Standard_L32s' * @member {string} [masterPoolProfile.subnetCidr] Subnet CIDR for the peering. * @member {string} [masterPoolProfile.osType] OsType to be used to specify os * type. Choose from Linux and Windows. Default to Linux. Possible values @@ -402,7 +424,7 @@ export interface ContainerServiceOrchestratorProfile { * @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} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {string} [firstConsecutiveStaticIP] FirstConsecutiveStaticIP used to * specify the first static ip of masters. Default value: '10.240.255.5' . @@ -410,7 +432,7 @@ export interface ContainerServiceOrchestratorProfile { * 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} [fqdn] FDQN for the master pool. + * @member {string} [fqdn] FQDN for the master pool. */ export interface ContainerServiceMasterProfile { count?: number; @@ -489,7 +511,7 @@ export interface ContainerServiceMasterProfile { * 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 {string} [fqdn] FQDN 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. @@ -497,7 +519,7 @@ export interface ContainerServiceMasterProfile { * 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 + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {string} [osType] OsType to be used to specify os type. Choose from * Linux and Windows. Default to Linux. Possible values include: 'Linux', @@ -706,14 +728,14 @@ 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. + * 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 * 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} [masterProfile.fqdn] FDQN for the master pool. + * @member {string} [masterProfile.fqdn] FQDN for the master pool. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [windowsProfile] Profile for Windows VMs in the container * service cluster. @@ -853,7 +875,7 @@ export interface ManagedClusterServicePrincipalProfile { * @member {number} [osDiskSizeGB] OS Disk Size in GB to be used to specify the * disk size for every machine in this master/agent pool. If you specify 0, it * will apply the default osDisk size according to the vmSize specified. - * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {number} [maxPods] Maximum number of pods that can run on a node. * @member {string} [osType] OsType to be used to specify os type. Choose from @@ -862,7 +884,7 @@ export interface ManagedClusterServicePrincipalProfile { * @member {number} [maxCount] Maximum number of nodes for auto-scaling * @member {number} [minCount] Minimum number of nodes for auto-scaling * @member {boolean} [enableAutoScaling] Whether to enable auto-scaler - * @member {string} [type] AgentPoolType represents types of agentpool. + * @member {string} [type] AgentPoolType represents types of an agent pool. * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' */ export interface ManagedClusterAgentPoolProfile { @@ -956,7 +978,7 @@ export interface ManagedClusterAADProfile { * 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} [fqdn] FQDN for the master pool. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. @@ -1116,7 +1138,7 @@ export interface CredentialResult { * @constructor * The list of credential result response. * - * @member {array} [kubeconfigs] + * @member {array} [kubeconfigs] Base64-encoded Kubernetes configuration file. */ export interface CredentialResults { readonly kubeconfigs?: CredentialResult[]; @@ -1162,6 +1184,19 @@ export interface OrchestratorVersionProfileListResult { } +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterListResult class. + * @constructor + * The response from the List OpenShift Managed Clusters operation. + * + * @member {string} [nextLink] The URL to get the next set of OpenShift managed + * cluster results. + */ +export interface OpenShiftManagedClusterListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the ContainerServiceListResult class. diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index fea896dbeb..9bf8a31aa1 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -58,6 +58,7 @@ exports.CredentialResult = require('./credentialResult'); exports.CredentialResults = require('./credentialResults'); exports.OrchestratorVersionProfile = require('./orchestratorVersionProfile'); exports.OrchestratorVersionProfileListResult = require('./orchestratorVersionProfileListResult'); +exports.OpenShiftManagedClusterListResult = require('./openShiftManagedClusterListResult'); exports.ContainerServiceListResult = require('./containerServiceListResult'); exports.OperationListResult = require('./operationListResult'); exports.ManagedClusterListResult = require('./managedClusterListResult'); diff --git a/lib/services/containerservicesManagement/lib/models/managedCluster.js b/lib/services/containerservicesManagement/lib/models/managedCluster.js index 7d0c528534..9a12b9f2af 100644 --- a/lib/services/containerservicesManagement/lib/models/managedCluster.js +++ b/lib/services/containerservicesManagement/lib/models/managedCluster.js @@ -26,7 +26,7 @@ class ManagedCluster extends models['Resource'] { * 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} [fqdn] FQDN for the master pool. * @member {array} [agentPoolProfiles] Properties of the agent pool. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js index b4ba2c9366..7ad3197a2c 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAgentPoolProfile.js @@ -77,7 +77,7 @@ class ManagedClusterAgentPoolProfile { * the disk size for every machine in this master/agent pool. If you specify * 0, it will apply the default osDisk size according to the vmSize * specified. - * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet * identifier. * @member {number} [maxPods] Maximum number of pods that can run on a node. * @member {string} [osType] OsType to be used to specify os type. Choose @@ -86,7 +86,7 @@ class ManagedClusterAgentPoolProfile { * @member {number} [maxCount] Maximum number of nodes for auto-scaling * @member {number} [minCount] Minimum number of nodes for auto-scaling * @member {boolean} [enableAutoScaling] Whether to enable auto-scaler - * @member {string} [type] AgentPoolType represents types of agentpool. + * @member {string} [type] AgentPoolType represents types of an agent pool. * Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' */ constructor() { diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js index 537bfd034d..5d811eecfc 100644 --- a/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js @@ -47,7 +47,16 @@ class OpenShiftManagedCluster extends models['Resource'] { * @member {number} [masterPoolProfile.count] Number of masters (VMs) to host * docker containers. The default value is 3. * @member {string} [masterPoolProfile.vmSize] Size of agent VMs. Possible - * values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * values include: 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * @member {string} [masterPoolProfile.subnetCidr] Subnet CIDR for the * peering. * @member {string} [masterPoolProfile.osType] OsType to be used to specify diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js index 56cc3d711a..01ae02ab47 100644 --- a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js @@ -20,10 +20,17 @@ class OpenShiftManagedClusterAgentPoolProfile { * @member {string} name Unique name of the 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 5 (inclusive). The default - * value is 2. . Default value: 2 . * @member {string} vmSize Size of agent VMs. Possible values include: - * 'Standard_D2s_v3', 'Standard_D4s_v3' + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * @member {string} [subnetCidr] Subnet CIDR for the peering. Default value: * '10.0.0.0/24' . * @member {string} [osType] OsType to be used to specify os type. Choose @@ -59,11 +66,6 @@ class OpenShiftManagedClusterAgentPoolProfile { count: { required: true, serializedName: 'count', - defaultValue: 2, - constraints: { - InclusiveMaximum: 5, - InclusiveMinimum: 1 - }, type: { name: 'Number' } diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js new file mode 100644 index 0000000000..bbc1a423a8 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List OpenShift Managed Clusters operation. + */ +class OpenShiftManagedClusterListResult extends Array { + /** + * Create a OpenShiftManagedClusterListResult. + * @member {string} [nextLink] The URL to get the next set of OpenShift + * managed cluster results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OpenShiftManagedClusterListResult + * + * @returns {object} metadata of OpenShiftManagedClusterListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterListResult', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterListResult', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OpenShiftManagedClusterElementType', + type: { + name: 'Composite', + className: 'OpenShiftManagedCluster' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterListResult; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterMasterPoolProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterMasterPoolProfile.js index d6785f597d..3e1c1e6080 100644 --- a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterMasterPoolProfile.js +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterMasterPoolProfile.js @@ -21,9 +21,18 @@ class OpenShiftManagedClusterMasterPoolProfile { * @member {string} [name] Unique name of the master pool profile in the * context of the subscription and resource group. * @member {number} count Number of masters (VMs) to host docker containers. - * The default value is 3. Default value: 3 . + * The default value is 3. * @member {string} vmSize Size of agent VMs. Possible values include: - * 'Standard_D2s_v3', 'Standard_D4s_v3' + * 'Standard_D2s_v3', 'Standard_D4s_v3', 'Standard_D8s_v3', + * 'Standard_D16s_v3', 'Standard_D32s_v3', 'Standard_D64s_v3', + * 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * @member {string} [subnetCidr] Subnet CIDR for the peering. * @member {string} [osType] OsType to be used to specify os type. Choose * from Linux and Windows. Default to Linux. Possible values include: @@ -56,11 +65,6 @@ class OpenShiftManagedClusterMasterPoolProfile { count: { required: true, serializedName: 'count', - defaultValue: 3, - constraints: { - InclusiveMaximum: 10, - InclusiveMinimum: 1 - }, type: { name: 'Number' } diff --git a/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js index 51296e4241..e0567d7f2a 100644 --- a/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js +++ b/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js @@ -18,7 +18,7 @@ class OpenShiftRouterProfile { /** * Create a OpenShiftRouterProfile. * @member {string} [name] Name of the router profile. - * @member {string} [publicSubdomain] DNS subdomain for openshift router. + * @member {string} [publicSubdomain] DNS subdomain for OpenShift router. * @member {string} [fqdn] Auto-allocated FQDN for the OpenShift router. */ constructor() { diff --git a/lib/services/containerservicesManagement/lib/operations/containerServices.js b/lib/services/containerservicesManagement/lib/operations/containerServices.js index 8d22b81dad..00c53a7b8d 100644 --- a/lib/services/containerservicesManagement/lib/operations/containerServices.js +++ b/lib/services/containerservicesManagement/lib/operations/containerServices.js @@ -274,7 +274,7 @@ function _list(options, callback) { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -759,7 +759,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * subscription. * * Gets a list of supported orchestrators in the specified subscription. The - * operation returns properties of each orchestrator including verison and + * operation returns properties of each orchestrator including version and * available upgrades. * * @param {string} location The name of a supported Azure region. @@ -1030,7 +1030,7 @@ function _listOrchestrators(location, options, callback) { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1892,7 +1892,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2088,7 +2088,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2478,7 +2478,7 @@ class ContainerServices { * subscription. * * Gets a list of supported orchestrators in the specified subscription. The - * operation returns properties of each orchestrator including verison and + * operation returns properties of each orchestrator including version and * available upgrades. * * @param {string} location The name of a supported Azure region. @@ -2516,7 +2516,7 @@ class ContainerServices { * subscription. * * Gets a list of supported orchestrators in the specified subscription. The - * operation returns properties of each orchestrator including verison and + * operation returns properties of each orchestrator including version and * available upgrades. * * @param {string} location The name of a supported Azure region. @@ -2695,7 +2695,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2891,7 +2891,7 @@ class ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * 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 1f60bdf48e..a519f3e4eb 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -22,14 +22,138 @@ export interface OpenShiftManagedClusters { /** - * @summary Gets a openshift managed cluster. + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OpenShiftManagedClusterListResult} - 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. + * + * {OpenShiftManagedClusterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedClusterListResult} 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; + + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * - * Gets the details of the managed openshift cluster with a specified resource + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {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 {OpenShiftManagedClusterListResult} - 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. + * + * {OpenShiftManagedClusterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedClusterListResult} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a OpenShift managed cluster. + * + * Gets the details of the managed OpenShift cluster with a specified resource * group and name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -46,14 +170,14 @@ export interface OpenShiftManagedClusters { getWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a openshift managed cluster. + * @summary Gets a OpenShift managed cluster. * - * Gets the details of the managed openshift cluster with a specified resource + * Gets the details of the managed OpenShift cluster with a specified resource * group and name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -90,14 +214,14 @@ export interface OpenShiftManagedClusters { /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -147,7 +271,16 @@ export interface OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -183,14 +316,14 @@ export interface OpenShiftManagedClusters { createOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -240,7 +373,16 @@ export interface OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -296,13 +438,13 @@ export interface OpenShiftManagedClusters { /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -324,13 +466,13 @@ export interface OpenShiftManagedClusters { updateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -372,14 +514,14 @@ export interface OpenShiftManagedClusters { /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -396,14 +538,14 @@ export interface OpenShiftManagedClusters { deleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -438,14 +580,14 @@ export interface OpenShiftManagedClusters { /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -495,7 +637,16 @@ export interface OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -531,14 +682,14 @@ export interface OpenShiftManagedClusters { beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -588,7 +739,16 @@ export interface OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -644,13 +804,13 @@ export interface OpenShiftManagedClusters { /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -672,13 +832,13 @@ export interface OpenShiftManagedClusters { beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -720,14 +880,14 @@ export interface OpenShiftManagedClusters { /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -744,14 +904,14 @@ export interface OpenShiftManagedClusters { beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -783,6 +943,138 @@ export interface OpenShiftManagedClusters { beginDeleteMethod(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginDeleteMethod(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; beginDeleteMethod(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OpenShiftManagedClusterListResult} - 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. + * + * {OpenShiftManagedClusterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedClusterListResult} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OpenShiftManagedClusterListResult} - 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. + * + * {OpenShiftManagedClusterListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedClusterListResult} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -977,7 +1269,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1161,7 +1453,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1455,7 +1747,7 @@ export interface ContainerServices { * subscription. * * Gets a list of supported orchestrators in the specified subscription. The - * operation returns properties of each orchestrator including verison and + * operation returns properties of each orchestrator including version and * available upgrades. * * @param {string} location The name of a supported Azure region. @@ -1481,7 +1773,7 @@ export interface ContainerServices { * subscription. * * Gets a list of supported orchestrators in the specified subscription. The - * operation returns properties of each orchestrator including verison and + * operation returns properties of each orchestrator including version and * available upgrades. * * @param {string} location The name of a supported Azure region. @@ -1645,7 +1937,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -1829,7 +2121,7 @@ export interface ContainerServices { * the vmSize specified. * * @param {string} [parameters.masterProfile.vnetSubnetID] VNet SubnetID - * specifies the vnet's subnet identifier. + * specifies the VNet's subnet identifier. * * @param {string} [parameters.masterProfile.firstConsecutiveStaticIP] * FirstConsecutiveStaticIP used to specify the first static ip of masters. @@ -2445,9 +2737,9 @@ export interface ManagedClusters { /** - * @summary Gets clusteradmin credential of a managed cluster. + * @summary Gets cluster admin credential of a managed cluster. * - * Gets clusteradmin credential of the managed cluster with a specified + * Gets cluster admin credential of the managed cluster with a specified * resource group and name. * * @param {string} resourceGroupName The name of the resource group. @@ -2468,9 +2760,9 @@ export interface ManagedClusters { listClusterAdminCredentialsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets clusteradmin credential of a managed cluster. + * @summary Gets cluster admin credential of a managed cluster. * - * Gets clusteradmin credential of the managed cluster with a specified + * Gets cluster admin credential of the managed cluster with a specified * resource group and name. * * @param {string} resourceGroupName The name of the resource group. @@ -2510,10 +2802,10 @@ export interface ManagedClusters { /** - * @summary Gets clusteruser credential of a managed cluster. + * @summary Gets cluster user credential of a managed cluster. * - * Gets clusteruser credential of the managed cluster with a specified resource - * group and name. + * Gets cluster user credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -2533,10 +2825,10 @@ export interface ManagedClusters { listClusterUserCredentialsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets clusteruser credential of a managed cluster. + * @summary Gets cluster user credential of a managed cluster. * - * Gets clusteruser credential of the managed cluster with a specified resource - * group and name. + * Gets cluster user credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -3009,6 +3301,174 @@ export interface ManagedClusters { deleteMethod(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @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. + */ + resetServicePrincipalProfileWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + resetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, callback: ServiceCallback): void; + resetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @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. + */ + resetAADProfileWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + resetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, callback: ServiceCallback): void; + resetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Creates or updates a managed cluster. * @@ -3379,6 +3839,174 @@ export interface ManagedClusters { beginDeleteMethod(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @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. + */ + beginResetServicePrincipalProfileWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginResetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, callback: ServiceCallback): void; + beginResetServicePrincipalProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterServicePrincipalProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @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. + */ + beginResetAADProfileWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginResetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, callback: ServiceCallback): void; + beginResetAADProfile(resourceGroupName: string, resourceName: string, parameters: models.ManagedClusterAADProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * @summary Gets a list of managed clusters in the specified subscription. * diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index 00592e6094..aebc51930a 100644 --- a/lib/services/containerservicesManagement/lib/operations/managedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/managedClusters.js @@ -196,6 +196,12 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (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.'); } @@ -339,6 +345,12 @@ function _getUpgradeProfile(resourceGroupName, resourceName, options, callback) if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -489,6 +501,12 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -593,9 +611,9 @@ function _getAccessProfile(resourceGroupName, resourceName, roleName, options, c } /** - * @summary Gets clusteradmin credential of a managed cluster. + * @summary Gets cluster admin credential of a managed cluster. * - * Gets clusteradmin credential of the managed cluster with a specified + * Gets cluster admin credential of the managed cluster with a specified * resource group and name. * * @param {string} resourceGroupName The name of the resource group. @@ -639,6 +657,12 @@ function _listClusterAdminCredentials(resourceGroupName, resourceName, options, if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -739,10 +763,10 @@ function _listClusterAdminCredentials(resourceGroupName, resourceName, options, } /** - * @summary Gets clusteruser credential of a managed cluster. + * @summary Gets cluster user credential of a managed cluster. * - * Gets clusteruser credential of the managed cluster with a specified resource - * group and name. + * Gets cluster user credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -785,6 +809,12 @@ function _listClusterUserCredentials(resourceGroupName, resourceName, options, c if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -931,6 +961,12 @@ function _get(resourceGroupName, resourceName, options, callback) { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -1346,6 +1382,158 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { }); } + +/** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetAADProfile(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginResetAADProfile(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + /** * @summary Creates or updates a managed cluster. * @@ -1478,6 +1666,12 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -1662,6 +1856,12 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -1823,6 +2023,12 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } @@ -1906,13 +2112,21 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) } /** - * @summary Gets a list of managed clusters in the specified subscription. + * @summary Reset Service Principal Profile of a managed cluster. * - * Gets a list of managed clusters in the specified subscription. The operation - * returns properties of each managed cluster. + * Update the service principal Profile for a managed cluster. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. * * @param {object} [options] Optional Parameters. * @@ -1925,15 +2139,13 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1943,10 +2155,26 @@ function _listNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-08-01-preview'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -1956,12 +2184,20 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1979,14 +2215,28 @@ function _listNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedClusterServicePrincipalProfile']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2014,37 +2264,33 @@ function _listNext(nextPageLink, options, callback) { // 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['ManagedClusterListResult']().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 Lists managed clusters in the specified subscription and resource - * group. + * @summary Reset AAD Profile of a managed cluster. * - * Lists managed clusters in the specified subscription and resource group. The - * operation returns properties of each managed cluster. + * Update the AAD Profile for a managed cluster. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. * * @param {object} [options] Optional Parameters. * @@ -2057,15 +2303,13 @@ function _listNext(nextPageLink, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedClusterListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listByResourceGroupNext(nextPageLink, options, callback) { +function _beginResetAADProfile(resourceGroupName, resourceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2075,13 +2319,297 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-08-01-preview'; // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ManagedClusterAADProfile']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of managed clusters in the specified subscription. + * + * Gets a list of managed clusters in the specified subscription. The operation + * returns properties of each managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedClusterListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ManagedClusterListResult']().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 Lists managed clusters in the specified subscription and resource + * group. + * + * Lists managed clusters in the specified subscription and resource group. The + * operation returns properties of each managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedClusterListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listByResourceGroupNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); } } catch (error) { return callback(error); @@ -2186,9 +2714,13 @@ class ManagedClusters { this._createOrUpdate = _createOrUpdate; this._updateTags = _updateTags; this._deleteMethod = _deleteMethod; + this._resetServicePrincipalProfile = _resetServicePrincipalProfile; + this._resetAADProfile = _resetAADProfile; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginUpdateTags = _beginUpdateTags; this._beginDeleteMethod = _beginDeleteMethod; + this._beginResetServicePrincipalProfile = _beginResetServicePrincipalProfile; + this._beginResetAADProfile = _beginResetAADProfile; this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; } @@ -2562,9 +3094,9 @@ class ManagedClusters { } /** - * @summary Gets clusteradmin credential of a managed cluster. + * @summary Gets cluster admin credential of a managed cluster. * - * Gets clusteradmin credential of the managed cluster with a specified + * Gets cluster admin credential of the managed cluster with a specified * resource group and name. * * @param {string} resourceGroupName The name of the resource group. @@ -2597,9 +3129,9 @@ class ManagedClusters { } /** - * @summary Gets clusteradmin credential of a managed cluster. + * @summary Gets cluster admin credential of a managed cluster. * - * Gets clusteradmin credential of the managed cluster with a specified + * Gets cluster admin credential of the managed cluster with a specified * resource group and name. * * @param {string} resourceGroupName The name of the resource group. @@ -2654,10 +3186,10 @@ class ManagedClusters { } /** - * @summary Gets clusteruser credential of a managed cluster. + * @summary Gets cluster user credential of a managed cluster. * - * Gets clusteruser credential of the managed cluster with a specified resource - * group and name. + * Gets cluster user credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -2689,10 +3221,10 @@ class ManagedClusters { } /** - * @summary Gets clusteruser credential of a managed cluster. + * @summary Gets cluster user credential of a managed cluster. * - * Gets clusteruser credential of the managed cluster with a specified resource - * group and name. + * Gets cluster user credential of the managed cluster with a specified + * resource group and name. * * @param {string} resourceGroupName The name of the resource group. * @@ -3044,13 +3576,203 @@ class ManagedClusters { * @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.aadProfile.tenantID] The AAD tenant ID to use + * for authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedCluster} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates tags on a managed cluster. + * + * Updates a managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Update Managed Cluster + * Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ManagedCluster} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ManagedCluster} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a managed cluster. + * + * Deletes the managed cluster with a specified resource group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a managed cluster. + * + * Deletes the managed cluster with a specified resource group and name. * - * @param {string} parameters.location Resource location + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} resourceName The name of the managed cluster resource. * * @param {object} [options] Optional Parameters. * @@ -3064,7 +3786,7 @@ class ManagedClusters { * * {Promise} A promise is returned * - * @resolve {ManagedCluster} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3072,14 +3794,13 @@ class ManagedClusters { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedCluster} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback) { + deleteMethod(resourceGroupName, resourceName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3088,30 +3809,33 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback); + return self._deleteMethod(resourceGroupName, resourceName, options, optionalCallback); } } /** - * @summary Updates tags on a managed cluster. + * @summary Reset Service Principal Profile of a managed cluster. * - * Updates a managed cluster with the specified tags. + * Update the service principal Profile for a managed cluster. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the managed cluster resource. * - * @param {object} parameters Parameters supplied to the Update Managed Cluster - * Tags operation. + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. * * @param {object} [options] Optional Parameters. * @@ -3120,15 +3844,15 @@ class ManagedClusters { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + resetServicePrincipalProfileWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + self._resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3139,18 +3863,21 @@ class ManagedClusters { } /** - * @summary Updates tags on a managed cluster. + * @summary Reset Service Principal Profile of a managed cluster. * - * Updates a managed cluster with the specified tags. + * Update the service principal Profile for a managed cluster. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the managed cluster resource. * - * @param {object} parameters Parameters supplied to the Update Managed Cluster - * Tags operation. + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. * * @param {object} [options] Optional Parameters. * @@ -3164,7 +3891,7 @@ class ManagedClusters { * * {Promise} A promise is returned * - * @resolve {ManagedCluster} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3172,14 +3899,13 @@ class ManagedClusters { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ManagedCluster} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3188,26 +3914,40 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + self._resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + return self._resetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, optionalCallback); } } /** - * @summary Deletes a managed cluster. + * @summary Reset AAD Profile of a managed cluster. * - * Deletes the managed cluster with a specified resource group and name. + * Update the AAD Profile for a managed cluster. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the managed cluster resource. * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3219,11 +3959,11 @@ class ManagedClusters { * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, resourceName, options) { + resetAADProfileWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._resetAADProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3234,14 +3974,28 @@ class ManagedClusters { } /** - * @summary Deletes a managed cluster. + * @summary Reset AAD Profile of a managed cluster. * - * Deletes the managed cluster with a specified resource group and name. + * Update the AAD Profile for a managed cluster. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} resourceName The name of the managed cluster resource. * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3268,7 +4022,7 @@ class ManagedClusters { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, resourceName, options, optionalCallback) { + resetAADProfile(resourceGroupName, resourceName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3277,14 +4031,14 @@ class ManagedClusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + self._resetAADProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, resourceName, options, optionalCallback); + return self._resetAADProfile(resourceGroupName, resourceName, parameters, options, optionalCallback); } } @@ -3739,6 +4493,228 @@ class ManagedClusters { } } + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @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. + */ + beginResetServicePrincipalProfileWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset Service Principal Profile of a managed cluster. + * + * Update the service principal Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset Service + * Principal Profile operation for a Managed Cluster. + * + * @param {string} parameters.clientId The ID for the service principal. + * + * @param {string} [parameters.secret] The secret password associated with the + * service principal in plain text. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginResetServicePrincipalProfile(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @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. + */ + beginResetAADProfileWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginResetAADProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset AAD Profile of a managed cluster. + * + * Update the AAD Profile for a managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the managed cluster resource. + * + * @param {object} parameters Parameters supplied to the Reset AAD Profile + * operation for a Managed Cluster. + * + * @param {string} parameters.clientAppID The client AAD application ID. + * + * @param {string} parameters.serverAppID The server AAD application ID. + * + * @param {string} [parameters.serverAppSecret] The server AAD application + * secret. + * + * @param {string} [parameters.tenantID] The AAD tenant ID to use for + * authentication. If not specified, will use the tenant of the deployment + * subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginResetAADProfile(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginResetAADProfile(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginResetAADProfile(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + /** * @summary Gets a list of managed clusters in the specified subscription. * diff --git a/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js b/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js index 5e250223a1..31e01f3057 100644 --- a/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js @@ -15,15 +15,11 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Gets a openshift managed cluster. + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. * - * Gets the details of the managed openshift cluster with a specified resource - * group and name. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the openshift managed cluster - * resource. + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. * * @param {object} [options] Optional Parameters. * @@ -37,14 +33,14 @@ const WebResource = msRest.WebResource; * {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 OpenShiftManagedCluster} for more + * See {@link OpenShiftManagedClusterListResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, resourceName, options, callback) { +function _list(options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60,12 +56,6 @@ function _get(resourceGroupName, resourceName, options, callback) { if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { - throw new Error('resourceName cannot be null or undefined and it must be of type string.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -75,10 +65,8 @@ function _get(resourceGroupName, resourceName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { @@ -147,7 +135,7 @@ function _get(resourceGroupName, resourceName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + let resultMapper = new client.models['OpenShiftManagedClusterListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -162,87 +150,15 @@ function _get(resourceGroupName, resourceName, options, callback) { }); } - /** - * @summary Creates or updates an openshift managed cluster. + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. * - * Creates or updates a openshift managed cluster with the specified - * configuration for agents and OpenShift version. + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster - * resource. - * - * @param {object} parameters Parameters supplied to the Create or Update an - * OpenShift Managed Cluster operation. - * - * @param {object} [parameters.plan] Define the resource plan as required by - * ARM for billing purposes - * - * @param {string} [parameters.plan.name] The plan ID. - * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. - * - * @param {string} [parameters.plan.promotionCode] The promotion code. - * - * @param {string} [parameters.plan.publisher] The plan ID. - * - * @param {string} parameters.openShiftVersion Version of OpenShift specified - * when creating the cluster. - * - * @param {string} [parameters.publicHostname] Optional user-specified FQDN for - * OpenShift API server. - * - * @param {string} [parameters.fqdn] User-specified FQDN for OpenShift API - * server loadbalancer internal hostname. - * - * @param {object} [parameters.networkProfile] Configuration for OpenShift - * networking. - * - * @param {string} [parameters.networkProfile.vnetCidr] CIDR for the OpenShift - * Vnet. - * - * @param {string} [parameters.networkProfile.peerVnetId] CIDR of the Vnet to - * peer. - * - * @param {array} [parameters.routerProfiles] Configuration for OpenShift - * router(s). - * - * @param {object} [parameters.masterPoolProfile] Configuration for OpenShift - * master VMs. - * - * @param {string} [parameters.masterPoolProfile.name] Unique name of the - * master pool profile in the context of the subscription and resource group. - * - * @param {number} parameters.masterPoolProfile.count Number of masters (VMs) - * to host docker containers. The default value is 3. - * - * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' - * - * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for - * the peering. - * - * @param {string} [parameters.masterPoolProfile.osType] OsType to be used to - * specify os type. Choose from Linux and Windows. Default to Linux. Possible - * values include: 'Linux', 'Windows' - * - * @param {array} [parameters.agentPoolProfiles] Configuration of OpenShift - * cluster VMs. - * - * @param {object} [parameters.authProfile] Configures OpenShift - * authentication. - * - * @param {array} [parameters.authProfile.identityProviders] Type of - * authentication profile to use. - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -255,51 +171,119 @@ function _get(resourceGroupName, resourceName, options, callback) { * {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 OpenShiftManagedCluster} for more + * See {@link OpenShiftManagedClusterListResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _createOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { +function _listByResourceGroup(resourceGroupName, 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-09-30-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (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); + } - // Send request - this.beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // 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; - - // Deserialize Response + 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['OpenShiftManagedCluster']().mapper(); + let resultMapper = new client.models['OpenShiftManagedClusterListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -308,28 +292,23 @@ function _createOrUpdate(resourceGroupName, resourceName, parameters, options, c deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } - /** - * @summary Updates tags on an openshift managed cluster. + * @summary Gets a OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Gets the details of the managed OpenShift cluster with a specified resource + * group and name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * - * @param {object} parameters Parameters supplied to the Update OpenShift - * Managed Cluster Tags operation. - * - * @param {object} [parameters.tags] Resource tags. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -349,38 +328,110 @@ function _createOrUpdate(resourceGroupName, resourceName, parameters, options, c * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateTags(resourceGroupName, resourceName, parameters, options, callback) { +function _get(resourceGroupName, resourceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { callback = options; options = null; } - if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-09-30-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } - // Send request - this.beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } - // Deserialize Response + // 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); @@ -395,24 +446,102 @@ function _updateTags(resourceGroupName, resourceName, parameters, options, callb deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and - * name. + * Creates or updates a OpenShift managed cluster with the specified + * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * + * @param {object} parameters Parameters supplied to the Create or Update an + * OpenShift Managed Cluster operation. + * + * @param {object} [parameters.plan] Define the resource plan as required by + * ARM for billing purposes + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} [parameters.plan.publisher] The plan ID. + * + * @param {string} parameters.openShiftVersion Version of OpenShift specified + * when creating the cluster. + * + * @param {string} [parameters.publicHostname] Optional user-specified FQDN for + * OpenShift API server. + * + * @param {string} [parameters.fqdn] User-specified FQDN for OpenShift API + * server loadbalancer internal hostname. + * + * @param {object} [parameters.networkProfile] Configuration for OpenShift + * networking. + * + * @param {string} [parameters.networkProfile.vnetCidr] CIDR for the OpenShift + * Vnet. + * + * @param {string} [parameters.networkProfile.peerVnetId] CIDR of the Vnet to + * peer. + * + * @param {array} [parameters.routerProfiles] Configuration for OpenShift + * router(s). + * + * @param {object} [parameters.masterPoolProfile] Configuration for OpenShift + * master VMs. + * + * @param {string} [parameters.masterPoolProfile.name] Unique name of the + * master pool profile in the context of the subscription and resource group. + * + * @param {number} parameters.masterPoolProfile.count Number of masters (VMs) + * to host docker containers. The default value is 3. + * + * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' + * + * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for + * the peering. + * + * @param {string} [parameters.masterPoolProfile.osType] OsType to be used to + * specify os type. Choose from Linux and Windows. Default to Linux. Possible + * values include: 'Linux', 'Windows' + * + * @param {array} [parameters.agentPoolProfiles] Configuration of OpenShift + * cluster VMs. + * + * @param {object} [parameters.authProfile] Configures OpenShift + * authentication. + * + * @param {array} [parameters.authProfile.identityProviders] Type of + * authentication profile to use. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -424,13 +553,15 @@ function _updateTags(resourceGroupName, resourceName, parameters, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} 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 _deleteMethod(resourceGroupName, resourceName, options, callback) { +function _createOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -443,7 +574,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { } // Send request - this.beginDeleteMethod(resourceGroupName, resourceName, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -462,71 +593,248 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { if (responseBody === '') responseBody = null; // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } return callback(null, result, httpRequest, response); }); }); } + /** - * @summary Creates or updates an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified - * configuration for agents and OpenShift version. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * - * @param {object} parameters Parameters supplied to the Create or Update an - * OpenShift Managed Cluster operation. + * @param {object} parameters Parameters supplied to the Update OpenShift + * Managed Cluster Tags operation. * - * @param {object} [parameters.plan] Define the resource plan as required by - * ARM for billing purposes + * @param {object} [parameters.tags] Resource tags. * - * @param {string} [parameters.plan.name] The plan ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.plan.product] Specifies the product of the image - * from the marketplace. This is the same value as Offer under the - * imageReference element. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * @param {function} callback - The callback. * - * @param {string} [parameters.plan.publisher] The plan ID. + * @returns {function} callback(err, result, request, response) * - * @param {string} parameters.openShiftVersion Version of OpenShift specified - * when creating the cluster. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.publicHostname] Optional user-specified FQDN for - * OpenShift API server. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. * - * @param {string} [parameters.fqdn] User-specified FQDN for OpenShift API - * server loadbalancer internal hostname. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [parameters.networkProfile] Configuration for OpenShift - * networking. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _updateTags(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Deletes an OpenShift managed cluster. * - * @param {string} [parameters.networkProfile.vnetCidr] CIDR for the OpenShift - * Vnet. + * Deletes the OpenShift managed cluster with a specified resource group and + * name. * - * @param {string} [parameters.networkProfile.peerVnetId] CIDR of the Vnet to - * peer. + * @param {string} resourceGroupName The name of the resource group. * - * @param {array} [parameters.routerProfiles] Configuration for OpenShift - * router(s). + * @param {string} resourceName The name of the OpenShift managed cluster + * resource. * - * @param {object} [parameters.masterPoolProfile] Configuration for OpenShift - * master VMs. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.masterPoolProfile.name] Unique name of the + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, resourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, resourceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Creates or updates an OpenShift managed cluster. + * + * Creates or updates a OpenShift managed cluster with the specified + * configuration for agents and OpenShift version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the OpenShift managed cluster + * resource. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * OpenShift Managed Cluster operation. + * + * @param {object} [parameters.plan] Define the resource plan as required by + * ARM for billing purposes + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} [parameters.plan.publisher] The plan ID. + * + * @param {string} parameters.openShiftVersion Version of OpenShift specified + * when creating the cluster. + * + * @param {string} [parameters.publicHostname] Optional user-specified FQDN for + * OpenShift API server. + * + * @param {string} [parameters.fqdn] User-specified FQDN for OpenShift API + * server loadbalancer internal hostname. + * + * @param {object} [parameters.networkProfile] Configuration for OpenShift + * networking. + * + * @param {string} [parameters.networkProfile.vnetCidr] CIDR for the OpenShift + * Vnet. + * + * @param {string} [parameters.networkProfile.peerVnetId] CIDR of the Vnet to + * peer. + * + * @param {array} [parameters.routerProfiles] Configuration for OpenShift + * router(s). + * + * @param {object} [parameters.masterPoolProfile] Configuration for OpenShift + * master VMs. + * + * @param {string} [parameters.masterPoolProfile.name] Unique name of the * master pool profile in the context of the subscription and resource group. * * @param {number} parameters.masterPoolProfile.count Number of masters (VMs) * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -541,12 +849,375 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * @param {object} [parameters.authProfile] Configures OpenShift * authentication. * - * @param {array} [parameters.authProfile.identityProviders] Type of - * authentication profile to use. + * @param {array} [parameters.authProfile.identityProviders] Type of + * authentication profile to use. + * + * @param {string} parameters.location Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-30-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['OpenShiftManagedCluster']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates tags on an OpenShift managed cluster. + * + * Updates an OpenShift managed cluster with the specified tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the OpenShift managed cluster + * resource. + * + * @param {object} parameters Parameters supplied to the Update OpenShift + * Managed Cluster Tags operation. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} 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 _beginUpdateTags(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-09-30-preview'; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } + if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { + throw new Error('resourceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['TagsObject']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + 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['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Deletes an OpenShift managed cluster. + * + * Deletes the OpenShift managed cluster with a specified resource group and + * name. * - * @param {string} parameters.location Resource location + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.tags] Resource tags + * @param {string} resourceName The name of the OpenShift managed cluster + * resource. * * @param {object} [options] Optional Parameters. * @@ -559,15 +1230,13 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * * {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 OpenShiftManagedCluster} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, callback) { +function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -586,12 +1255,15 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + } if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { throw new Error('resourceName cannot be null or undefined and it must be of type string.'); } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); - } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -613,7 +1285,7 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -631,28 +1303,14 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['OpenShiftManagedCluster']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -680,59 +1338,20 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio // 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['OpenShiftManagedCluster']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError1.request = msRest.stripRequest(httpRequest); - deserializationError1.response = msRest.stripResponse(response); - return callback(deserializationError1); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Updates tags on an openshift managed cluster. - * - * Updates an openshift managed cluster with the specified tags. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} resourceName The name of the openshift managed cluster - * resource. + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. * - * @param {object} parameters Parameters supplied to the Update OpenShift - * Managed Cluster Tags operation. + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -746,14 +1365,14 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio * {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 OpenShiftManagedCluster} for more + * See {@link OpenShiftManagedClusterListResult} 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 _beginUpdateTags(resourceGroupName, resourceName, parameters, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -763,20 +1382,10 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-30-preview'; // Validate try { - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceName === null || resourceName === undefined || typeof resourceName.valueOf() !== 'string') { - throw new Error('resourceName cannot be null or undefined and it must be of type string.'); - } - if (parameters === null || parameters === undefined) { - throw new Error('parameters cannot be null or undefined.'); + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -786,20 +1395,12 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -817,21 +1418,7 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['TagsObject']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -873,7 +1460,7 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + let resultMapper = new client.models['OpenShiftManagedClusterListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -889,15 +1476,14 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, } /** - * @summary Deletes an openshift managed cluster. - * - * Deletes the openshift managed cluster with a specified resource group and - * name. + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. * - * @param {string} resourceGroupName The name of the resource group. + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. * - * @param {string} resourceName The name of the openshift managed cluster - * resource. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -910,13 +1496,15 @@ function _beginUpdateTags(resourceGroupName, resourceName, parameters, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedClusterListResult} 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 _beginDeleteMethod(resourceGroupName, resourceName, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -926,17 +1514,10 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2018-09-30-preview'; // 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 (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -946,20 +1527,12 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) } // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{resourceName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{resourceName}', encodeURIComponent(resourceName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -984,7 +1557,7 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 202 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1009,40 +1582,239 @@ function _beginDeleteMethod(resourceGroupName, resourceName, options, callback) } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // 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['OpenShiftManagedClusterListResult']().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 OpenShiftManagedClusters. */ +class OpenShiftManagedClusters { + /** + * Create a OpenShiftManagedClusters. + * @param {ContainerServiceClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._updateTags = _updateTags; + this._deleteMethod = _deleteMethod; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginUpdateTags = _beginUpdateTags; + this._beginDeleteMethod = _beginDeleteMethod; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + 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; + }); + }); + } + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OpenShiftManagedClusterListResult} - 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 OpenShiftManagedClusterListResult} 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); + } + } - return callback(null, result, httpRequest, response); - }); -} + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } -/** Class representing a OpenShiftManagedClusters. */ -class OpenShiftManagedClusters { /** - * Create a OpenShiftManagedClusters. - * @param {ContainerServiceClient} client Reference to the service client. + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OpenShiftManagedClusterListResult} - 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 OpenShiftManagedClusterListResult} 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. */ - constructor(client) { - this.client = client; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._updateTags = _updateTags; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginUpdateTags = _beginUpdateTags; - this._beginDeleteMethod = _beginDeleteMethod; + listByResourceGroup(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } } /** - * @summary Gets a openshift managed cluster. + * @summary Gets a OpenShift managed cluster. * - * Gets the details of the managed openshift cluster with a specified resource + * Gets the details of the managed OpenShift cluster with a specified resource * group and name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1071,14 +1843,14 @@ class OpenShiftManagedClusters { } /** - * @summary Gets a openshift managed cluster. + * @summary Gets a OpenShift managed cluster. * - * Gets the details of the managed openshift cluster with a specified resource + * Gets the details of the managed OpenShift cluster with a specified resource * group and name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1130,14 +1902,14 @@ class OpenShiftManagedClusters { } /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -1187,7 +1959,16 @@ class OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -1235,14 +2016,14 @@ class OpenShiftManagedClusters { } /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -1292,7 +2073,16 @@ class OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -1363,13 +2153,13 @@ class OpenShiftManagedClusters { } /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -1403,13 +2193,13 @@ class OpenShiftManagedClusters { } /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -1466,14 +2256,14 @@ class OpenShiftManagedClusters { } /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1502,14 +2292,14 @@ class OpenShiftManagedClusters { } /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1559,14 +2349,14 @@ class OpenShiftManagedClusters { } /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -1616,7 +2406,16 @@ class OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -1664,14 +2463,14 @@ class OpenShiftManagedClusters { } /** - * @summary Creates or updates an openshift managed cluster. + * @summary Creates or updates an OpenShift managed cluster. * - * Creates or updates a openshift managed cluster with the specified + * Creates or updates a OpenShift managed cluster with the specified * configuration for agents and OpenShift version. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Create or Update an @@ -1721,7 +2520,16 @@ class OpenShiftManagedClusters { * to host docker containers. The default value is 3. * * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. - * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3', + * 'Standard_D8s_v3', 'Standard_D16s_v3', 'Standard_D32s_v3', + * 'Standard_D64s_v3', 'Standard_DS4_v2', 'Standard_DS5_v2', 'Standard_F8s_v2', + * 'Standard_F16s_v2', 'Standard_F32s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8s', 'Standard_F16s', 'Standard_E4s_v3', + * 'Standard_E8s_v3', 'Standard_E16s_v3', 'Standard_E20s_v3', + * 'Standard_E32s_v3', 'Standard_E64s_v3', 'Standard_GS2', 'Standard_GS3', + * 'Standard_GS4', 'Standard_GS5', 'Standard_DS12_v2', 'Standard_DS13_v2', + * 'Standard_DS14_v2', 'Standard_DS15_v2', 'Standard_L4s', 'Standard_L8s', + * 'Standard_L16s', 'Standard_L32s' * * @param {string} [parameters.masterPoolProfile.subnetCidr] Subnet CIDR for * the peering. @@ -1792,13 +2600,13 @@ class OpenShiftManagedClusters { } /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -1832,13 +2640,13 @@ class OpenShiftManagedClusters { } /** - * @summary Updates tags on an openshift managed cluster. + * @summary Updates tags on an OpenShift managed cluster. * - * Updates an openshift managed cluster with the specified tags. + * Updates an OpenShift managed cluster with the specified tags. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} parameters Parameters supplied to the Update OpenShift @@ -1895,14 +2703,14 @@ class OpenShiftManagedClusters { } /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1931,14 +2739,14 @@ class OpenShiftManagedClusters { } /** - * @summary Deletes an openshift managed cluster. + * @summary Deletes an OpenShift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and + * Deletes the OpenShift managed cluster with a specified resource group and * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} resourceName The name of the openshift managed cluster + * @param {string} resourceName The name of the OpenShift managed cluster * resource. * * @param {object} [options] Optional Parameters. @@ -1987,6 +2795,192 @@ class OpenShiftManagedClusters { } } + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. + * + * Gets a list of OpenShift managed clusters in the specified subscription. The + * operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OpenShiftManagedClusterListResult} - 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 OpenShiftManagedClusterListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists OpenShift managed clusters in the specified subscription and + * resource group. + * + * Lists OpenShift managed clusters in the specified subscription and resource + * group. The operation returns properties of each OpenShift managed cluster. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OpenShiftManagedClusterListResult} - 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 OpenShiftManagedClusterListResult} 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. + */ + listByResourceGroupNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + } module.exports = OpenShiftManagedClusters;