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/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index fd01ccbd07..ff6912b031 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -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 @@ -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/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/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index 1f60bdf48e..6851628a3b 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -21,6 +21,130 @@ import * as models from '../models'; export interface 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 {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. + * + * @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. * @@ -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. @@ -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. @@ -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. @@ -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. @@ -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; } /** diff --git a/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js b/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js index 5e250223a1..521aeed67f 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. - * - * Gets the details of the managed openshift cluster with a specified resource - * group and name. + * @summary Gets a list of OpenShift managed clusters in the specified + * subscription. * - * @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,113 @@ 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 (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 +286,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 * 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,31 +322,258 @@ 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 (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); + // 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 Result - let result = null; + // 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['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. + * + * 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', + * '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 + * 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 _createOrUpdate(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.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; httpRequest = pollingResult.request; response = pollingResult.response; @@ -403,16 +603,20 @@ function _updateTags(resourceGroupName, resourceName, parameters, options, callb /** - * @summary Deletes an openshift managed cluster. + * @summary Updates tags on an openshift managed cluster. * - * Deletes the openshift managed cluster with a specified resource group and - * name. + * 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 @@ -424,13 +628,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 _updateTags(resourceGroupName, resourceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -443,7 +649,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { } // Send request - this.beginDeleteMethod(resourceGroupName, resourceName, options, (err, parsedResult, httpRequest, response) => { + this.beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -462,38 +668,119 @@ 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 Deletes an openshift managed cluster. * - * Creates or updates a openshift managed cluster with the specified - * configuration for agents and OpenShift version. + * 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 * resource. * - * @param {object} parameters Parameters supplied to the Create or Update an - * OpenShift Managed Cluster operation. + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.plan] Define the resource plan as required by - * ARM for billing purposes + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.plan.name] The plan ID. + * @param {function} callback - The callback. * - * @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. + * @returns {function} callback(err, result, request, response) * - * @param {string} [parameters.plan.promotionCode] The promotion code. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [parameters.plan.publisher] The plan ID. + * {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. @@ -526,7 +813,16 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * 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 +837,363 @@ 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 (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 (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 +1206,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') { @@ -589,9 +1234,6 @@ function _beginCreateOrUpdate(resourceGroupName, resourceName, parameters, optio 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 +1255,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 +1273,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 +1308,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 +1335,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 +1352,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 +1365,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 +1388,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 +1430,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 +1446,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 +1466,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 +1484,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 +1497,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 +1527,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,29 +1552,228 @@ 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); + } } /** @@ -1187,7 +1929,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. @@ -1292,7 +2043,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. @@ -1616,7 +2376,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. @@ -1721,7 +2490,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. @@ -1987,6 +2765,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;