diff --git a/lib/services/containerservicesManagement/README.md b/lib/services/containerservicesManagement/README.md index bcda4fd300..2a1bd6ba5d 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 list containerServices as an example. +### Authentication, client creation and get openShiftManagedClusters as an example. ```javascript const msRestAzure = require("ms-rest-azure"); @@ -26,7 +26,9 @@ const ContainerServiceClient = require("azure-arm-containerservice"); msRestAzure.interactiveLogin().then((creds) => { const subscriptionId = ""; const client = new ContainerServiceClient(creds, subscriptionId); - return client.containerServices.list().then((result) => { + const resourceGroupName = "testresourceGroupName"; + const resourceName = "testresourceName"; + return client.openShiftManagedClusters.get(resourceGroupName, resourceName).then((result) => { console.log("The result is:"); console.log(result); }); diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts index 67db569fd8..988e12858e 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.d.ts @@ -54,6 +54,7 @@ export default class ContainerServiceClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + openShiftManagedClusters: operations.OpenShiftManagedClusters; containerServices: operations.ContainerServices; operations: operations.Operations; managedClusters: operations.ManagedClusters; diff --git a/lib/services/containerservicesManagement/lib/containerServiceClient.js b/lib/services/containerservicesManagement/lib/containerServiceClient.js index 23e4792c0e..142bb2aa12 100644 --- a/lib/services/containerservicesManagement/lib/containerServiceClient.js +++ b/lib/services/containerservicesManagement/lib/containerServiceClient.js @@ -71,6 +71,7 @@ class ContainerServiceClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.openShiftManagedClusters = new operations.OpenShiftManagedClusters(this); this.containerServices = new operations.ContainerServices(this); this.operations = new operations.Operations(this); this.managedClusters = new operations.ManagedClusters(this); diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js index 1ca0c5fa2d..2ba40526cb 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceDiagnosticsProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Profile for diagnostics on the container service cluster. * diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js index 56c1403758..ccd6312a79 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceLinuxProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Profile for Linux VMs in the container service cluster. * diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js b/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js index 7823f2a0dd..462806938f 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceServicePrincipalProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Information about a service principal identity for the cluster to use for * manipulating Azure APIs. Either secret or keyVaultSecretRef must be diff --git a/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js b/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js index a77522abe0..51cd3fdead 100644 --- a/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js +++ b/lib/services/containerservicesManagement/lib/models/containerServiceSshConfiguration.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SSH configuration for Linux-based VMs running on Azure. * diff --git a/lib/services/containerservicesManagement/lib/models/credentialResults.js b/lib/services/containerservicesManagement/lib/models/credentialResults.js index 550c9a367b..c6c3842e35 100644 --- a/lib/services/containerservicesManagement/lib/models/credentialResults.js +++ b/lib/services/containerservicesManagement/lib/models/credentialResults.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of credential result response. * diff --git a/lib/services/containerservicesManagement/lib/models/index.d.ts b/lib/services/containerservicesManagement/lib/models/index.d.ts index 57c6766bc1..401777381b 100644 --- a/lib/services/containerservicesManagement/lib/models/index.d.ts +++ b/lib/services/containerservicesManagement/lib/models/index.d.ts @@ -36,6 +36,238 @@ export interface Resource extends BaseResource { tags?: { [propertyName: string]: string }; } +/** + * @class + * Initializes a new instance of the PurchasePlan class. + * @constructor + * Used for establishing the purchase context of any 3rd Party artifact through + * MarketPlace. + * + * @member {string} [name] The plan ID. + * @member {string} [product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [promotionCode] The promotion code. + * @member {string} [publisher] The plan ID. + */ +export interface PurchasePlan { + name?: string; + product?: string; + promotionCode?: string; + publisher?: string; +} + +/** + * @class + * Initializes a new instance of the OpenShiftRouterProfile class. + * @constructor + * Represents an OpenShift router + * + * @member {string} [name] Name of the router profile. + * @member {string} [publicSubdomain] DNS subdomain for openshift router. + * @member {string} [fqdn] Auto-allocated FQDN for the OpenShift router. + */ +export interface OpenShiftRouterProfile { + name?: string; + publicSubdomain?: string; + readonly fqdn?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkProfile class. + * @constructor + * Represents the OpenShift networking configuration + * + * @member {string} [vnetCidr] CIDR for the OpenShift Vnet. Default value: + * '10.0.0.0/8' . + * @member {string} [peerVnetId] CIDR of the Vnet to peer. + */ +export interface NetworkProfile { + vnetCidr?: string; + peerVnetId?: string; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterMasterPoolProfile class. + * @constructor + * OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift + * master VMs. + * + * @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 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * 'Standard_D2s_v3', 'Standard_D4s_v3' + * @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', + * 'Windows'. Default value: 'Linux' . + */ +export interface OpenShiftManagedClusterMasterPoolProfile { + name?: string; + count: number; + vmSize: string; + subnetCidr?: string; + osType?: string; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterAgentPoolProfile class. + * @constructor + * Defines the configuration of the OpenShift cluster VMs. + * + * @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' + * @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 + * Linux and Windows. Default to Linux. Possible values include: 'Linux', + * 'Windows'. Default value: 'Linux' . + * @member {string} [role] Define the role of the AgentPoolProfile. Possible + * values include: 'compute', 'infra' + */ +export interface OpenShiftManagedClusterAgentPoolProfile { + name: string; + count: number; + vmSize: string; + subnetCidr?: string; + osType?: string; + role?: string; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterBaseIdentityProvider class. + * @constructor + * Structure for any Identity provider. + * + * @member {string} kind Polymorphic Discriminator + */ +export interface OpenShiftManagedClusterBaseIdentityProvider { + kind: string; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterIdentityProvider class. + * @constructor + * Defines the configuration of the identity providers to be used in the + * OpenShift cluster. + * + * @member {string} [name] Name of the provider. + * @member {object} [provider] Configuration of the provider. + * @member {string} [provider.kind] Polymorphic Discriminator + */ +export interface OpenShiftManagedClusterIdentityProvider { + name?: string; + provider?: OpenShiftManagedClusterBaseIdentityProvider; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterAuthProfile class. + * @constructor + * Defines all possible authentication profiles for the OpenShift cluster. + * + * @member {array} [identityProviders] Type of authentication profile to use. + */ +export interface OpenShiftManagedClusterAuthProfile { + identityProviders?: OpenShiftManagedClusterIdentityProvider[]; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedCluster class. + * @constructor + * OpenShift Managed cluster. + * + * @member {object} [plan] Define the resource plan as required by ARM for + * billing purposes + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.publisher] The plan ID. + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response. + * @member {string} openShiftVersion Version of OpenShift specified when + * creating the cluster. + * @member {string} [publicHostname] Optional user-specified FQDN for OpenShift + * API server. + * @member {string} [fqdn] User-specified FQDN for OpenShift API server + * loadbalancer internal hostname. + * @member {object} [networkProfile] Configuration for OpenShift networking. + * @member {string} [networkProfile.vnetCidr] CIDR for the OpenShift Vnet. + * @member {string} [networkProfile.peerVnetId] CIDR of the Vnet to peer. + * @member {array} [routerProfiles] Configuration for OpenShift router(s). + * @member {object} [masterPoolProfile] Configuration for OpenShift master VMs. + * @member {string} [masterPoolProfile.name] Unique name of the master pool + * profile in the context of the subscription and resource group. + * @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' + * @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 + * include: 'Linux', 'Windows' + * @member {array} [agentPoolProfiles] Configuration of OpenShift cluster VMs. + * @member {object} [authProfile] Configures OpenShift authentication. + * @member {array} [authProfile.identityProviders] Type of authentication + * profile to use. + */ +export interface OpenShiftManagedCluster extends Resource { + plan?: PurchasePlan; + readonly provisioningState?: string; + openShiftVersion: string; + publicHostname?: string; + fqdn?: string; + networkProfile?: NetworkProfile; + routerProfiles?: OpenShiftRouterProfile[]; + masterPoolProfile?: OpenShiftManagedClusterMasterPoolProfile; + agentPoolProfiles?: OpenShiftManagedClusterAgentPoolProfile[]; + authProfile?: OpenShiftManagedClusterAuthProfile; +} + +/** + * @class + * Initializes a new instance of the OpenShiftManagedClusterAADIdentityProvider class. + * @constructor + * Defines the Identity provider for MS AAD. + * + * @member {string} [clientId] The clientId password associated with the + * provider. + * @member {string} [secret] The secret password associated with the provider. + * @member {string} [tenantId] The tenantId associated with the provider. + */ +export interface OpenShiftManagedClusterAADIdentityProvider extends OpenShiftManagedClusterBaseIdentityProvider { + clientId?: string; + secret?: string; + tenantId?: string; +} + +/** + * @class + * Initializes a new instance of the TagsObject class. + * @constructor + * Tags object for patch operations. + * + * @member {object} [tags] Resource tags. + */ +export interface TagsObject { + tags?: { [propertyName: string]: string }; +} + /** * @class * Initializes a new instance of the ContainerServiceCustomProfile class. @@ -541,18 +773,6 @@ export interface OperationValue { readonly provider?: string; } -/** - * @class - * Initializes a new instance of the TagsObject class. - * @constructor - * Tags object for patch operations. - * - * @member {object} [tags] Resource tags. - */ -export interface TagsObject { - tags?: { [propertyName: string]: string }; -} - /** * @class * Initializes a new instance of the ManagedClusterServicePrincipalProfile class. @@ -708,14 +928,14 @@ export interface ManagedClusterAddonProfile { * * @member {string} clientAppID The client AAD application ID. * @member {string} serverAppID The server AAD application ID. - * @member {string} serverAppSecret The server AAD application secret. + * @member {string} [serverAppSecret] The server AAD application secret. * @member {string} [tenantID] The AAD tenant ID to use for authentication. If * not specified, will use the tenant of the deployment subscription. */ export interface ManagedClusterAADProfile { clientAppID: string; serverAppID: string; - serverAppSecret: string; + serverAppSecret?: string; tenantID?: string; } @@ -732,7 +952,8 @@ export interface ManagedClusterAADProfile { * @member {string} [dnsPrefix] DNS prefix specified when creating the managed * cluster. * @member {string} [fqdn] FDQN for the master pool. - * @member {array} [agentPoolProfiles] Properties of the agent pool. + * @member {array} [agentPoolProfiles] Properties of the agent pool. Currently + * only one agent pool can exist. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. * @member {string} [linuxProfile.adminUsername] The administrator username to diff --git a/lib/services/containerservicesManagement/lib/models/index.js b/lib/services/containerservicesManagement/lib/models/index.js index ac1d174e45..fea896dbeb 100644 --- a/lib/services/containerservicesManagement/lib/models/index.js +++ b/lib/services/containerservicesManagement/lib/models/index.js @@ -19,6 +19,17 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; exports.Resource = require('./resource'); +exports.PurchasePlan = require('./purchasePlan'); +exports.OpenShiftRouterProfile = require('./openShiftRouterProfile'); +exports.NetworkProfile = require('./networkProfile'); +exports.OpenShiftManagedClusterMasterPoolProfile = require('./openShiftManagedClusterMasterPoolProfile'); +exports.OpenShiftManagedClusterAgentPoolProfile = require('./openShiftManagedClusterAgentPoolProfile'); +exports.OpenShiftManagedClusterBaseIdentityProvider = require('./openShiftManagedClusterBaseIdentityProvider'); +exports.OpenShiftManagedClusterIdentityProvider = require('./openShiftManagedClusterIdentityProvider'); +exports.OpenShiftManagedClusterAuthProfile = require('./openShiftManagedClusterAuthProfile'); +exports.OpenShiftManagedCluster = require('./openShiftManagedCluster'); +exports.OpenShiftManagedClusterAADIdentityProvider = require('./openShiftManagedClusterAADIdentityProvider'); +exports.TagsObject = require('./tagsObject'); exports.ContainerServiceCustomProfile = require('./containerServiceCustomProfile'); exports.KeyVaultSecretRef = require('./keyVaultSecretRef'); exports.ContainerServiceServicePrincipalProfile = require('./containerServiceServicePrincipalProfile'); @@ -33,7 +44,6 @@ exports.ContainerServiceVMDiagnostics = require('./containerServiceVMDiagnostics exports.ContainerServiceDiagnosticsProfile = require('./containerServiceDiagnosticsProfile'); exports.ContainerService = require('./containerService'); exports.OperationValue = require('./operationValue'); -exports.TagsObject = require('./tagsObject'); exports.ManagedClusterServicePrincipalProfile = require('./managedClusterServicePrincipalProfile'); exports.ManagedClusterAgentPoolProfile = require('./managedClusterAgentPoolProfile'); exports.ContainerServiceNetworkProfile = require('./containerServiceNetworkProfile'); @@ -51,3 +61,7 @@ exports.OrchestratorVersionProfileListResult = require('./orchestratorVersionPro exports.ContainerServiceListResult = require('./containerServiceListResult'); exports.OperationListResult = require('./operationListResult'); exports.ManagedClusterListResult = require('./managedClusterListResult'); +exports.discriminators = { + 'OpenShiftManagedClusterBaseIdentityProvider' : exports.OpenShiftManagedClusterBaseIdentityProvider, + 'OpenShiftManagedClusterBaseIdentityProvider.AADIdentityProvider' : exports.OpenShiftManagedClusterAADIdentityProvider +}; diff --git a/lib/services/containerservicesManagement/lib/models/managedCluster.js b/lib/services/containerservicesManagement/lib/models/managedCluster.js index 7d0c528534..158deed57e 100644 --- a/lib/services/containerservicesManagement/lib/models/managedCluster.js +++ b/lib/services/containerservicesManagement/lib/models/managedCluster.js @@ -28,6 +28,7 @@ class ManagedCluster extends models['Resource'] { * managed cluster. * @member {string} [fqdn] FDQN for the master pool. * @member {array} [agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * @member {object} [linuxProfile] Profile for Linux VMs in the container * service cluster. * @member {string} [linuxProfile.adminUsername] The administrator username diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js index 8f76641400..6647d93681 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterAADProfile.js @@ -19,7 +19,7 @@ class ManagedClusterAADProfile { * Create a ManagedClusterAADProfile. * @member {string} clientAppID The client AAD application ID. * @member {string} serverAppID The server AAD application ID. - * @member {string} serverAppSecret The server AAD application secret. + * @member {string} [serverAppSecret] The server AAD application secret. * @member {string} [tenantID] The AAD tenant ID to use for authentication. * If not specified, will use the tenant of the deployment subscription. */ @@ -55,7 +55,7 @@ class ManagedClusterAADProfile { } }, serverAppSecret: { - required: true, + required: false, serializedName: 'serverAppSecret', type: { name: 'String' diff --git a/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js b/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js index ddb99f2a26..633dcbc3a2 100644 --- a/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js +++ b/lib/services/containerservicesManagement/lib/models/managedClusterUpgradeProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of available upgrades for compute pools. * diff --git a/lib/services/containerservicesManagement/lib/models/networkProfile.js b/lib/services/containerservicesManagement/lib/models/networkProfile.js new file mode 100644 index 0000000000..1a2216d43e --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/networkProfile.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Represents the OpenShift networking configuration + * + */ +class NetworkProfile { + /** + * Create a NetworkProfile. + * @member {string} [vnetCidr] CIDR for the OpenShift Vnet. Default value: + * '10.0.0.0/8' . + * @member {string} [peerVnetId] CIDR of the Vnet to peer. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkProfile + * + * @returns {object} metadata of NetworkProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile', + modelProperties: { + vnetCidr: { + required: false, + serializedName: 'vnetCidr', + defaultValue: '10.0.0.0/8', + type: { + name: 'String' + } + }, + peerVnetId: { + required: false, + serializedName: 'peerVnetId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NetworkProfile; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js new file mode 100644 index 0000000000..537bfd034d --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedCluster.js @@ -0,0 +1,222 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * OpenShift Managed cluster. + * + * @extends models['Resource'] + */ +class OpenShiftManagedCluster extends models['Resource'] { + /** + * Create a OpenShiftManagedCluster. + * @member {object} [plan] Define the resource plan as required by ARM for + * billing purposes + * @member {string} [plan.name] The plan ID. + * @member {string} [plan.product] Specifies the product of the image from + * the marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [plan.promotionCode] The promotion code. + * @member {string} [plan.publisher] The plan ID. + * @member {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response. + * @member {string} openShiftVersion Version of OpenShift specified when + * creating the cluster. + * @member {string} [publicHostname] Optional user-specified FQDN for + * OpenShift API server. + * @member {string} [fqdn] User-specified FQDN for OpenShift API server + * loadbalancer internal hostname. + * @member {object} [networkProfile] Configuration for OpenShift networking. + * @member {string} [networkProfile.vnetCidr] CIDR for the OpenShift Vnet. + * @member {string} [networkProfile.peerVnetId] CIDR of the Vnet to peer. + * @member {array} [routerProfiles] Configuration for OpenShift router(s). + * @member {object} [masterPoolProfile] Configuration for OpenShift master + * VMs. + * @member {string} [masterPoolProfile.name] Unique name of the master pool + * profile in the context of the subscription and resource group. + * @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' + * @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 + * include: 'Linux', 'Windows' + * @member {array} [agentPoolProfiles] Configuration of OpenShift cluster + * VMs. + * @member {object} [authProfile] Configures OpenShift authentication. + * @member {array} [authProfile.identityProviders] Type of authentication + * profile to use. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OpenShiftManagedCluster + * + * @returns {object} metadata of OpenShiftManagedCluster + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedCluster', + type: { + name: 'Composite', + className: 'OpenShiftManagedCluster', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + plan: { + required: false, + serializedName: 'plan', + type: { + name: 'Composite', + className: 'PurchasePlan' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + openShiftVersion: { + required: true, + serializedName: 'properties.openShiftVersion', + type: { + name: 'String' + } + }, + publicHostname: { + required: false, + serializedName: 'properties.publicHostname', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + serializedName: 'properties.fqdn', + type: { + name: 'String' + } + }, + networkProfile: { + required: false, + serializedName: 'properties.networkProfile', + type: { + name: 'Composite', + className: 'NetworkProfile' + } + }, + routerProfiles: { + required: false, + serializedName: 'properties.routerProfiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OpenShiftRouterProfileElementType', + type: { + name: 'Composite', + className: 'OpenShiftRouterProfile' + } + } + } + }, + masterPoolProfile: { + required: false, + serializedName: 'properties.masterPoolProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterMasterPoolProfile' + } + }, + agentPoolProfiles: { + required: false, + serializedName: 'properties.agentPoolProfiles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OpenShiftManagedClusterAgentPoolProfileElementType', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterAgentPoolProfile' + } + } + } + }, + authProfile: { + required: false, + serializedName: 'properties.authProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterAuthProfile' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedCluster; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAADIdentityProvider.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAADIdentityProvider.js new file mode 100644 index 0000000000..9c8466fc9f --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAADIdentityProvider.js @@ -0,0 +1,87 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Defines the Identity provider for MS AAD. + * + * @extends models['OpenShiftManagedClusterBaseIdentityProvider'] + */ +class OpenShiftManagedClusterAADIdentityProvider extends models['OpenShiftManagedClusterBaseIdentityProvider'] { + /** + * Create a OpenShiftManagedClusterAADIdentityProvider. + * @member {string} [clientId] The clientId password associated with the + * provider. + * @member {string} [secret] The secret password associated with the + * provider. + * @member {string} [tenantId] The tenantId associated with the provider. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OpenShiftManagedClusterAADIdentityProvider + * + * @returns {object} metadata of OpenShiftManagedClusterAADIdentityProvider + * + */ + mapper() { + return { + required: false, + serializedName: 'AADIdentityProvider', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'OpenShiftManagedClusterBaseIdentityProvider', + className: 'OpenShiftManagedClusterAADIdentityProvider', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + clientId: { + required: false, + serializedName: 'clientId', + type: { + name: 'String' + } + }, + secret: { + required: false, + serializedName: 'secret', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + serializedName: 'tenantId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterAADIdentityProvider; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js new file mode 100644 index 0000000000..56cc3d711a --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAgentPoolProfile.js @@ -0,0 +1,107 @@ +/* + * 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'; + +/** + * Defines the configuration of the OpenShift cluster VMs. + * + */ +class OpenShiftManagedClusterAgentPoolProfile { + /** + * Create a 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' + * @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 Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows'. Default value: 'Linux' . + * @member {string} [role] Define the role of the AgentPoolProfile. Possible + * values include: 'compute', 'infra' + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterAgentPoolProfile + * + * @returns {object} metadata of OpenShiftManagedClusterAgentPoolProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterAgentPoolProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterAgentPoolProfile', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: true, + serializedName: 'count', + defaultValue: 2, + constraints: { + InclusiveMaximum: 5, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + subnetCidr: { + required: false, + serializedName: 'subnetCidr', + defaultValue: '10.0.0.0/24', + type: { + name: 'String' + } + }, + osType: { + required: false, + serializedName: 'osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + }, + role: { + required: false, + serializedName: 'role', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterAgentPoolProfile; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAuthProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAuthProfile.js new file mode 100644 index 0000000000..38dae8a61c --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAuthProfile.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines all possible authentication profiles for the OpenShift cluster. + * + */ +class OpenShiftManagedClusterAuthProfile { + /** + * Create a OpenShiftManagedClusterAuthProfile. + * @member {array} [identityProviders] Type of authentication profile to use. + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterAuthProfile + * + * @returns {object} metadata of OpenShiftManagedClusterAuthProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterAuthProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterAuthProfile', + modelProperties: { + identityProviders: { + required: false, + serializedName: 'identityProviders', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OpenShiftManagedClusterIdentityProviderElementType', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterIdentityProvider' + } + } + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterAuthProfile; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAzProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAzProfile.js new file mode 100644 index 0000000000..a20ab296e9 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterAzProfile.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * AzProfile holds the azure context for where the cluster resides. + * + */ +class OpenShiftManagedClusterAzProfile { + /** + * Create a OpenShiftManagedClusterAzProfile. + * @member {string} [tenantId] The tenantId of the subscription where the + * cluster resides. + * @member {string} [subscriptionId] The subscriptionId f the subscription + * where the cluster resides. + * @member {string} [resourceGroup] The resourceGroup f the subscription + * where the cluster resides. + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterAzProfile + * + * @returns {object} metadata of OpenShiftManagedClusterAzProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterAzProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterAzProfile', + modelProperties: { + tenantId: { + required: false, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + subscriptionId: { + required: false, + serializedName: 'subscriptionId', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + serializedName: 'resourceGroup', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterAzProfile; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterBaseIdentityProvider.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterBaseIdentityProvider.js new file mode 100644 index 0000000000..7dbbce4e19 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterBaseIdentityProvider.js @@ -0,0 +1,58 @@ +/* + * 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'; + +/** + * Structure for any Identity provider. + * + */ +class OpenShiftManagedClusterBaseIdentityProvider { + /** + * Create a OpenShiftManagedClusterBaseIdentityProvider. + * @member {string} kind Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterBaseIdentityProvider + * + * @returns {object} metadata of OpenShiftManagedClusterBaseIdentityProvider + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterBaseIdentityProvider', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'OpenShiftManagedClusterBaseIdentityProvider', + className: 'OpenShiftManagedClusterBaseIdentityProvider', + modelProperties: { + kind: { + required: true, + serializedName: 'kind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterBaseIdentityProvider; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProvider.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProvider.js new file mode 100644 index 0000000000..a2c9c01578 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProvider.js @@ -0,0 +1,68 @@ +/* + * 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'; + +/** + * Defines the configuration of the identity providers to be used in the + * OpenShift cluster. + * + */ +class OpenShiftManagedClusterIdentityProvider { + /** + * Create a OpenShiftManagedClusterIdentityProvider. + * @member {string} [name] Name of the provider. + * @member {object} [provider] Configuration of the provider. + * @member {string} [provider.kind] Polymorphic Discriminator + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterIdentityProvider + * + * @returns {object} metadata of OpenShiftManagedClusterIdentityProvider + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterIdentityProvider', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterIdentityProvider', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'kind', + clientName: 'kind' + }, + uberParent: 'OpenShiftManagedClusterBaseIdentityProvider', + className: 'OpenShiftManagedClusterBaseIdentityProvider' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterIdentityProvider; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProviders.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProviders.js new file mode 100644 index 0000000000..ca1b5e3080 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterIdentityProviders.js @@ -0,0 +1,61 @@ +/* + * 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'; + +/** + * Defines the configuration of the identity providers to be used in the + * OpenShift cluster. + * + */ +class OpenShiftManagedClusterIdentityProviders { + /** + * Create a OpenShiftManagedClusterIdentityProviders. + * @member {string} [name] Name of the provider. + * @member {object} [provider] Configuration of the provider. + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterIdentityProviders + * + * @returns {object} metadata of OpenShiftManagedClusterIdentityProviders + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterIdentityProviders', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterIdentityProviders', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + provider: { + required: false, + serializedName: 'provider', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterIdentityProviders; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js new file mode 100644 index 0000000000..fd1243358a --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterListResult.js @@ -0,0 +1,70 @@ +/* + * 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 { + /** + * Create a OpenShiftManagedClusterListResult. + * @member {array} [value] The list of openshift managed clusters. + * @member {string} [nextLink] The URL to get the next set of openshift + * managed cluster results. + */ + constructor() { + } + + /** + * 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: 'value', + 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 new file mode 100644 index 0000000000..d6785f597d --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterMasterPoolProfile.js @@ -0,0 +1,96 @@ +/* + * 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'; + +/** + * OpenShiftManagedClusterMaterPoolProfile contains configuration for OpenShift + * master VMs. + * + */ +class OpenShiftManagedClusterMasterPoolProfile { + /** + * Create a 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 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * 'Standard_D2s_v3', 'Standard_D4s_v3' + * @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', 'Windows'. Default value: 'Linux' . + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterMasterPoolProfile + * + * @returns {object} metadata of OpenShiftManagedClusterMasterPoolProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterMasterPoolProfile', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterMasterPoolProfile', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: true, + serializedName: 'count', + defaultValue: 3, + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + subnetCidr: { + required: false, + serializedName: 'subnetCidr', + type: { + name: 'String' + } + }, + osType: { + required: false, + serializedName: 'osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterMasterPoolProfile; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterProfileSpec.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterProfileSpec.js new file mode 100644 index 0000000000..6cea8595b7 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterProfileSpec.js @@ -0,0 +1,146 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Profile for the container service agent pool. + * + */ +class OpenShiftManagedClusterProfileSpec { + /** + * Create a OpenShiftManagedClusterProfileSpec. + * @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 100 (inclusive). The default + * value is 1. . Default value: 1 . + * @member {string} vmSize Size of agent VMs. Possible values include: + * 'Standard_A1', 'Standard_A10', 'Standard_A11', 'Standard_A1_v2', + * 'Standard_A2', 'Standard_A2_v2', 'Standard_A2m_v2', 'Standard_A3', + * 'Standard_A4', 'Standard_A4_v2', 'Standard_A4m_v2', 'Standard_A5', + * 'Standard_A6', 'Standard_A7', 'Standard_A8', 'Standard_A8_v2', + * 'Standard_A8m_v2', 'Standard_A9', 'Standard_B2ms', 'Standard_B2s', + * 'Standard_B4ms', 'Standard_B8ms', 'Standard_D1', 'Standard_D11', + * 'Standard_D11_v2', 'Standard_D11_v2_Promo', 'Standard_D12', + * 'Standard_D12_v2', 'Standard_D12_v2_Promo', 'Standard_D13', + * 'Standard_D13_v2', 'Standard_D13_v2_Promo', 'Standard_D14', + * 'Standard_D14_v2', 'Standard_D14_v2_Promo', 'Standard_D15_v2', + * 'Standard_D16_v3', 'Standard_D16s_v3', 'Standard_D1_v2', 'Standard_D2', + * 'Standard_D2_v2', 'Standard_D2_v2_Promo', 'Standard_D2_v3', + * 'Standard_D2s_v3', 'Standard_D3', 'Standard_D32_v3', 'Standard_D32s_v3', + * 'Standard_D3_v2', 'Standard_D3_v2_Promo', 'Standard_D4', 'Standard_D4_v2', + * 'Standard_D4_v2_Promo', 'Standard_D4_v3', 'Standard_D4s_v3', + * 'Standard_D5_v2', 'Standard_D5_v2_Promo', 'Standard_D64_v3', + * 'Standard_D64s_v3', 'Standard_D8_v3', 'Standard_D8s_v3', 'Standard_DS1', + * 'Standard_DS11', 'Standard_DS11_v2', 'Standard_DS11_v2_Promo', + * 'Standard_DS12', 'Standard_DS12_v2', 'Standard_DS12_v2_Promo', + * 'Standard_DS13', 'Standard_DS13-2_v2', 'Standard_DS13-4_v2', + * 'Standard_DS13_v2', 'Standard_DS13_v2_Promo', 'Standard_DS14', + * 'Standard_DS14-4_v2', 'Standard_DS14-8_v2', 'Standard_DS14_v2', + * 'Standard_DS14_v2_Promo', 'Standard_DS15_v2', 'Standard_DS1_v2', + * 'Standard_DS2', 'Standard_DS2_v2', 'Standard_DS2_v2_Promo', + * 'Standard_DS3', 'Standard_DS3_v2', 'Standard_DS3_v2_Promo', + * 'Standard_DS4', 'Standard_DS4_v2', 'Standard_DS4_v2_Promo', + * 'Standard_DS5_v2', 'Standard_DS5_v2_Promo', 'Standard_E16_v3', + * 'Standard_E16s_v3', 'Standard_E2_v3', 'Standard_E2s_v3', + * 'Standard_E32-16s_v3', 'Standard_E32-8s_v3', 'Standard_E32_v3', + * 'Standard_E32s_v3', 'Standard_E4_v3', 'Standard_E4s_v3', + * 'Standard_E64-16s_v3', 'Standard_E64-32s_v3', 'Standard_E64_v3', + * 'Standard_E64s_v3', 'Standard_E8_v3', 'Standard_E8s_v3', 'Standard_F1', + * 'Standard_F16', 'Standard_F16s', 'Standard_F16s_v2', 'Standard_F1s', + * 'Standard_F2', 'Standard_F2s', 'Standard_F2s_v2', 'Standard_F32s_v2', + * 'Standard_F4', 'Standard_F4s', 'Standard_F4s_v2', 'Standard_F64s_v2', + * 'Standard_F72s_v2', 'Standard_F8', 'Standard_F8s', 'Standard_F8s_v2', + * 'Standard_G1', 'Standard_G2', 'Standard_G3', 'Standard_G4', 'Standard_G5', + * 'Standard_GS1', 'Standard_GS2', 'Standard_GS3', 'Standard_GS4', + * 'Standard_GS4-4', 'Standard_GS4-8', 'Standard_GS5', 'Standard_GS5-16', + * 'Standard_GS5-8', 'Standard_H16', 'Standard_H16m', 'Standard_H16mr', + * 'Standard_H16r', 'Standard_H8', 'Standard_H8m', 'Standard_L16s', + * 'Standard_L32s', 'Standard_L4s', 'Standard_L8s', 'Standard_M128-32ms', + * 'Standard_M128-64ms', 'Standard_M128ms', 'Standard_M128s', + * 'Standard_M64-16ms', 'Standard_M64-32ms', 'Standard_M64ms', + * 'Standard_M64s', 'Standard_NC12', 'Standard_NC12s_v2', + * 'Standard_NC12s_v3', 'Standard_NC24', 'Standard_NC24r', + * 'Standard_NC24rs_v2', 'Standard_NC24rs_v3', 'Standard_NC24s_v2', + * 'Standard_NC24s_v3', 'Standard_NC6', 'Standard_NC6s_v2', + * 'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s', + * 'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6' + * @member {string} [vnetSubnetID] VNet SubnetID specifies the vnet's subnet + * identifier. + * @member {string} [osType] OsType to be used to specify os type. Choose + * from Linux and Windows. Default to Linux. Possible values include: + * 'Linux', 'Windows'. Default value: 'Linux' . + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterProfileSpec + * + * @returns {object} metadata of OpenShiftManagedClusterProfileSpec + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterProfileSpec', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterProfileSpec', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + count: { + required: true, + serializedName: 'count', + defaultValue: 1, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + vmSize: { + required: true, + serializedName: 'vmSize', + type: { + name: 'String' + } + }, + vnetSubnetID: { + required: false, + serializedName: 'vnetSubnetID', + type: { + name: 'String' + } + }, + osType: { + required: false, + serializedName: 'osType', + defaultValue: 'Linux', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterProfileSpec; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterServiceAADIdentityProvider.js b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterServiceAADIdentityProvider.js new file mode 100644 index 0000000000..f4e6ca006a --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftManagedClusterServiceAADIdentityProvider.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * AADIdentityProvider defines Identity provider for MS AAD. + * + */ +class OpenShiftManagedClusterServiceAADIdentityProvider { + /** + * Create a OpenShiftManagedClusterServiceAADIdentityProvider. + * @member {string} [clientId] The clientId password associated with the + * provider. + * @member {string} [secret] The secret password associated with the + * provider. + * @member {string} [tenantId] The tenantId associated with the provider. + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftManagedClusterServiceAADIdentityProvider + * + * @returns {object} metadata of OpenShiftManagedClusterServiceAADIdentityProvider + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftManagedClusterServiceAADIdentityProvider', + type: { + name: 'Composite', + className: 'OpenShiftManagedClusterServiceAADIdentityProvider', + modelProperties: { + kind: { + required: true, + isConstant: true, + serializedName: 'kind', + defaultValue: 'AADIdentityProvider', + type: { + name: 'String' + } + }, + clientId: { + required: false, + serializedName: 'clientId', + type: { + name: 'String' + } + }, + secret: { + required: false, + serializedName: 'secret', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + serializedName: 'tenantId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftManagedClusterServiceAADIdentityProvider; diff --git a/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js b/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.js new file mode 100644 index 0000000000..51296e4241 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/openShiftRouterProfile.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'; + +/** + * Represents an OpenShift router + * + */ +class OpenShiftRouterProfile { + /** + * Create a OpenShiftRouterProfile. + * @member {string} [name] Name of the router profile. + * @member {string} [publicSubdomain] DNS subdomain for openshift router. + * @member {string} [fqdn] Auto-allocated FQDN for the OpenShift router. + */ + constructor() { + } + + /** + * Defines the metadata of OpenShiftRouterProfile + * + * @returns {object} metadata of OpenShiftRouterProfile + * + */ + mapper() { + return { + required: false, + serializedName: 'OpenShiftRouterProfile', + type: { + name: 'Composite', + className: 'OpenShiftRouterProfile', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + publicSubdomain: { + required: false, + serializedName: 'publicSubdomain', + type: { + name: 'String' + } + }, + fqdn: { + required: false, + readOnly: true, + serializedName: 'fqdn', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OpenShiftRouterProfile; diff --git a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js index c72c478b43..a27be1de00 100644 --- a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js +++ b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfile.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The profile of an orchestrator and its available versions. * diff --git a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js index 4ce959deba..0aa579ef28 100644 --- a/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js +++ b/lib/services/containerservicesManagement/lib/models/orchestratorVersionProfileListResult.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * The list of versions for supported orchestrators. * diff --git a/lib/services/containerservicesManagement/lib/models/purchasePlan.js b/lib/services/containerservicesManagement/lib/models/purchasePlan.js new file mode 100644 index 0000000000..674a0f2fe5 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/models/purchasePlan.js @@ -0,0 +1,79 @@ +/* + * 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'; + +/** + * Used for establishing the purchase context of any 3rd Party artifact through + * MarketPlace. + * + */ +class PurchasePlan { + /** + * Create a PurchasePlan. + * @member {string} [name] The plan ID. + * @member {string} [product] Specifies the product of the image from the + * marketplace. This is the same value as Offer under the imageReference + * element. + * @member {string} [promotionCode] The promotion code. + * @member {string} [publisher] The plan ID. + */ + constructor() { + } + + /** + * Defines the metadata of PurchasePlan + * + * @returns {object} metadata of PurchasePlan + * + */ + mapper() { + return { + required: false, + serializedName: 'PurchasePlan', + type: { + name: 'Composite', + className: 'PurchasePlan', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'product', + type: { + name: 'String' + } + }, + promotionCode: { + required: false, + serializedName: 'promotionCode', + type: { + name: 'String' + } + }, + publisher: { + required: false, + serializedName: 'publisher', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PurchasePlan; diff --git a/lib/services/containerservicesManagement/lib/operations/index.d.ts b/lib/services/containerservicesManagement/lib/operations/index.d.ts index 0ea29f5c48..850f1bab13 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.d.ts +++ b/lib/services/containerservicesManagement/lib/operations/index.d.ts @@ -12,6 +12,779 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * OpenShiftManagedClusters + * __NOTE__: An instance of this class is automatically created for an + * instance of the ContainerServiceClient. + */ +export interface OpenShiftManagedClusters { + + + /** + * @summary Gets a openshift managed cluster. + * + * Gets the details of the managed openshift cluster with a specified resource + * group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a openshift managed cluster. + * + * Gets the details of the managed openshift cluster with a specified resource + * group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OpenShiftManagedCluster} - 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. + * + * {OpenShiftManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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' + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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' + * + * @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 {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 {OpenShiftManagedCluster} - 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. + * + * {OpenShiftManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates tags on 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 {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 {OpenShiftManagedCluster} - 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. + * + * {OpenShiftManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + updateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, resourceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, resourceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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' + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @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' + * + * @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 {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 {OpenShiftManagedCluster} - 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. + * + * {OpenShiftManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: models.OpenShiftManagedCluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates tags on 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 {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 {OpenShiftManagedCluster} - 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. + * + * {OpenShiftManagedCluster} [result] - The deserialized result object if an error did not occur. + * See {@link OpenShiftManagedCluster} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, callback: ServiceCallback): void; + beginUpdateTags(resourceGroupName: string, resourceName: string, parameters: models.TagsObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, resourceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, 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; +} + /** * @class * ContainerServices @@ -1886,6 +2659,7 @@ export interface ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -1950,7 +2724,7 @@ export interface ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -1994,6 +2768,7 @@ export interface ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -2058,7 +2833,7 @@ export interface ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -2256,6 +3031,7 @@ export interface ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -2320,7 +3096,7 @@ export interface ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -2364,6 +3140,7 @@ export interface ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -2428,7 +3205,7 @@ export interface ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use diff --git a/lib/services/containerservicesManagement/lib/operations/index.js b/lib/services/containerservicesManagement/lib/operations/index.js index da31241c46..dda2cf2c5c 100644 --- a/lib/services/containerservicesManagement/lib/operations/index.js +++ b/lib/services/containerservicesManagement/lib/operations/index.js @@ -14,6 +14,7 @@ 'use strict'; +exports.OpenShiftManagedClusters = require('./openShiftManagedClusters'); exports.ContainerServices = require('./containerServices'); exports.Operations = require('./operations'); exports.ManagedClusters = require('./managedClusters'); diff --git a/lib/services/containerservicesManagement/lib/operations/managedClusters.js b/lib/services/containerservicesManagement/lib/operations/managedClusters.js index 3b87ab2e87..fa9d0c11ea 100644 --- a/lib/services/containerservicesManagement/lib/operations/managedClusters.js +++ b/lib/services/containerservicesManagement/lib/operations/managedClusters.js @@ -1051,6 +1051,7 @@ function _get(resourceGroupName, resourceName, options, callback) { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -1115,7 +1116,7 @@ function _get(resourceGroupName, resourceName, options, callback) { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -1366,6 +1367,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -1430,7 +1432,7 @@ function _deleteMethod(resourceGroupName, resourceName, options, callback) { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -2857,6 +2859,7 @@ class ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -2921,7 +2924,7 @@ class ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -2977,6 +2980,7 @@ class ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -3041,7 +3045,7 @@ class ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -3308,6 +3312,7 @@ class ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -3372,7 +3377,7 @@ class ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use @@ -3428,6 +3433,7 @@ class ManagedClusters { * the managed cluster. * * @param {array} [parameters.agentPoolProfiles] Properties of the agent pool. + * Currently only one agent pool can exist. * * @param {object} [parameters.linuxProfile] Profile for Linux VMs in the * container service cluster. @@ -3492,7 +3498,7 @@ class ManagedClusters { * @param {string} parameters.aadProfile.serverAppID The server AAD application * ID. * - * @param {string} parameters.aadProfile.serverAppSecret The server AAD + * @param {string} [parameters.aadProfile.serverAppSecret] The server AAD * application secret. * * @param {string} [parameters.aadProfile.tenantID] The AAD tenant ID to use diff --git a/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js b/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js new file mode 100644 index 0000000000..5e250223a1 --- /dev/null +++ b/lib/services/containerservicesManagement/lib/operations/openShiftManagedClusters.js @@ -0,0 +1,1992 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a openshift managed cluster. + * + * Gets the details of the managed openshift cluster with a specified resource + * group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link 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 _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); + } + + // 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 = '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' + * + * @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; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary 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 _updateTags(resourceGroupName, resourceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OpenShiftManagedCluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, resourceName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, resourceName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Creates or updates an openshift managed cluster. + * + * Creates or updates a openshift managed cluster with the specified + * configuration for agents and OpenShift version. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} parameters Parameters supplied to the Create or Update an + * OpenShift Managed Cluster operation. + * + * @param {object} [parameters.plan] Define the resource plan as required by + * ARM for billing purposes + * + * @param {string} [parameters.plan.name] The plan ID. + * + * @param {string} [parameters.plan.product] Specifies the product of the image + * from the marketplace. This is the same value as Offer under the + * imageReference element. + * + * @param {string} [parameters.plan.promotionCode] The promotion code. + * + * @param {string} [parameters.plan.publisher] The plan ID. + * + * @param {string} parameters.openShiftVersion Version of OpenShift specified + * when creating the cluster. + * + * @param {string} [parameters.publicHostname] Optional user-specified FQDN for + * OpenShift API server. + * + * @param {string} [parameters.fqdn] User-specified FQDN for OpenShift API + * server loadbalancer internal hostname. + * + * @param {object} [parameters.networkProfile] Configuration for OpenShift + * networking. + * + * @param {string} [parameters.networkProfile.vnetCidr] CIDR for the OpenShift + * Vnet. + * + * @param {string} [parameters.networkProfile.peerVnetId] CIDR of the Vnet to + * peer. + * + * @param {array} [parameters.routerProfiles] Configuration for OpenShift + * router(s). + * + * @param {object} [parameters.masterPoolProfile] Configuration for OpenShift + * master VMs. + * + * @param {string} [parameters.masterPoolProfile.name] Unique name of the + * master pool profile in the context of the subscription and resource group. + * + * @param {number} parameters.masterPoolProfile.count Number of masters (VMs) + * to host docker containers. The default value is 3. + * + * @param {string} parameters.masterPoolProfile.vmSize Size of agent VMs. + * Possible values include: 'Standard_D2s_v3', 'Standard_D4s_v3' + * + * @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 _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} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, 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); + } + + // 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 = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a OpenShiftManagedClusters. */ +class OpenShiftManagedClusters { + /** + * Create a OpenShiftManagedClusters. + * @param {ContainerServiceClient} client Reference to the service client. + */ + 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; + } + + /** + * @summary Gets a openshift managed cluster. + * + * Gets the details of the managed openshift cluster with a specified resource + * group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a openshift managed cluster. + * + * Gets the details of the managed openshift cluster with a specified resource + * group and name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} resourceName The name of the openshift managed cluster + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OpenShiftManagedCluster} - 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 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. + */ + get(resourceGroupName, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * @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' + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary 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' + * + * @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} [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 {OpenShiftManagedCluster} - 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 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. + */ + createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates tags on 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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates tags on 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} [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 {OpenShiftManagedCluster} - 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 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. + */ + updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, resourceName, options, optionalCallback); + } + } + + /** + * @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' + * + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary 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' + * + * @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} [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 {OpenShiftManagedCluster} - 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 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. + */ + beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @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 + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginUpdateTagsWithHttpOperationResponse(resourceGroupName, resourceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates tags on 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} [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 {OpenShiftManagedCluster} - 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 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. + */ + beginUpdateTags(resourceGroupName, resourceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdateTags(resourceGroupName, resourceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, resourceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes an openshift managed cluster. + * + * 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} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, resourceName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, resourceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, resourceName, options, optionalCallback); + } + } + +} + +module.exports = OpenShiftManagedClusters; diff --git a/lib/services/containerservicesManagement/package.json b/lib/services/containerservicesManagement/package.json index d68df6d24b..9a78b4d520 100644 --- a/lib/services/containerservicesManagement/package.json +++ b/lib/services/containerservicesManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-containerservice", "author": "Microsoft Corporation", "description": "ContainerServiceClient Library with typescript type definitions for node", - "version": "4.0.0", + "version": "5.0.1", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/containerServiceClient.js", "types": "./lib/containerServiceClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/containerservicesManagement", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git"