diff --git a/packages/@azure/arm-containerservice/lib/containerServiceClient.ts b/packages/@azure/arm-containerservice/lib/containerServiceClient.ts index 05e56c8fc1b7..c9223ea22fc3 100644 --- a/packages/@azure/arm-containerservice/lib/containerServiceClient.ts +++ b/packages/@azure/arm-containerservice/lib/containerServiceClient.ts @@ -21,6 +21,7 @@ class ContainerServiceClient extends ContainerServiceClientContext { containerServices: operations.ContainerServices; operations: operations.Operations; managedClusters: operations.ManagedClusters; + agentPools: operations.AgentPools; /** * Initializes a new instance of the ContainerServiceClient class. @@ -35,6 +36,7 @@ class ContainerServiceClient extends ContainerServiceClientContext { this.containerServices = new operations.ContainerServices(this); this.operations = new operations.Operations(this); this.managedClusters = new operations.ManagedClusters(this); + this.agentPools = new operations.AgentPools(this); } } diff --git a/packages/@azure/arm-containerservice/lib/models/agentPoolsMappers.ts b/packages/@azure/arm-containerservice/lib/models/agentPoolsMappers.ts new file mode 100644 index 000000000000..6261be0e0b9b --- /dev/null +++ b/packages/@azure/arm-containerservice/lib/models/agentPoolsMappers.ts @@ -0,0 +1,51 @@ +/* + * 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. + */ + +export { + discriminators, + AgentPoolListResult, + AgentPool, + SubResource, + BaseResource, + CloudError, + Resource, + OpenShiftManagedCluster, + PurchasePlan, + NetworkProfile, + OpenShiftRouterProfile, + OpenShiftManagedClusterMasterPoolProfile, + OpenShiftManagedClusterAgentPoolProfile, + OpenShiftManagedClusterAuthProfile, + OpenShiftManagedClusterIdentityProvider, + OpenShiftManagedClusterBaseIdentityProvider, + OpenShiftManagedClusterAADIdentityProvider, + ContainerService, + ContainerServiceOrchestratorProfile, + ContainerServiceCustomProfile, + ContainerServiceServicePrincipalProfile, + KeyVaultSecretRef, + ContainerServiceMasterProfile, + ContainerServiceAgentPoolProfile, + ContainerServiceWindowsProfile, + ContainerServiceLinuxProfile, + ContainerServiceSshConfiguration, + ContainerServiceSshPublicKey, + ContainerServiceDiagnosticsProfile, + ContainerServiceVMDiagnostics, + ManagedCluster, + ManagedClusterAgentPoolProfile, + ManagedClusterAgentPoolProfileProperties, + ManagedClusterServicePrincipalProfile, + ManagedClusterAddonProfile, + ContainerServiceNetworkProfile, + ManagedClusterAADProfile, + ManagedClusterAccessProfile +} from "../models/mappers"; + diff --git a/packages/@azure/arm-containerservice/lib/models/containerServicesMappers.ts b/packages/@azure/arm-containerservice/lib/models/containerServicesMappers.ts index 77e3392bdf31..a364fa736219 100644 --- a/packages/@azure/arm-containerservice/lib/models/containerServicesMappers.ts +++ b/packages/@azure/arm-containerservice/lib/models/containerServicesMappers.ts @@ -40,8 +40,11 @@ export { OpenShiftManagedClusterIdentityProvider, OpenShiftManagedClusterBaseIdentityProvider, OpenShiftManagedClusterAADIdentityProvider, + SubResource, + AgentPool, ManagedCluster, ManagedClusterAgentPoolProfile, + ManagedClusterAgentPoolProfileProperties, ManagedClusterServicePrincipalProfile, ManagedClusterAddonProfile, ContainerServiceNetworkProfile, diff --git a/packages/@azure/arm-containerservice/lib/models/index.ts b/packages/@azure/arm-containerservice/lib/models/index.ts index a552aca6f9c0..2a606a2bee69 100644 --- a/packages/@azure/arm-containerservice/lib/models/index.ts +++ b/packages/@azure/arm-containerservice/lib/models/index.ts @@ -879,6 +879,35 @@ export interface OperationValue { readonly provider?: string; } +/** + * @interface + * An interface representing SubResource. + * Reference to another subresource. + * + * @extends BaseResource + */ +export interface SubResource extends BaseResource { + /** + * @member {string} [id] Resource ID. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly id?: string; + /** + * @member {string} [name] The name of the resource that is unique within a + * resource group. This name can be used to access the resource. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly name?: string; + /** + * @member {string} [type] Resource type + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly type?: string; +} + /** * @interface * An interface representing ManagedClusterServicePrincipalProfile. @@ -898,18 +927,151 @@ export interface ManagedClusterServicePrincipalProfile { secret?: string; } +/** + * @interface + * An interface representing ManagedClusterAgentPoolProfileProperties. + * Properties for the container service agent pool profile. + * + */ +export interface ManagedClusterAgentPoolProfileProperties { + /** + * @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 . + */ + count: number; + /** + * @member {ContainerServiceVMSizeTypes} 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' + */ + vmSize: ContainerServiceVMSizeTypes; + /** + * @member {number} [osDiskSizeGB] OS Disk Size in GB to be used to specify + * the disk size for every machine in this master/agent pool. If you specify + * 0, it will apply the default osDisk size according to the vmSize + * specified. + */ + osDiskSizeGB?: number; + /** + * @member {string} [vnetSubnetID] VNet SubnetID specifies the VNet's subnet + * identifier. + */ + vnetSubnetID?: string; + /** + * @member {number} [maxPods] Maximum number of pods that can run on a node. + */ + maxPods?: number; + /** + * @member {OSType} [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' . + */ + osType?: OSType; + /** + * @member {number} [maxCount] Maximum number of nodes for auto-scaling + */ + maxCount?: number; + /** + * @member {number} [minCount] Minimum number of nodes for auto-scaling + */ + minCount?: number; + /** + * @member {boolean} [enableAutoScaling] Whether to enable auto-scaler + */ + enableAutoScaling?: boolean; + /** + * @member {AgentPoolType} [type] AgentPoolType represents types of an agent + * pool. Possible values include: 'VirtualMachineScaleSets', + * 'AvailabilitySet' + */ + type?: AgentPoolType; + /** + * @member {string} [orchestratorVersion] Version of orchestrator specified + * when creating the managed cluster. + */ + orchestratorVersion?: string; + /** + * @member {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; +} + /** * @interface * An interface representing ManagedClusterAgentPoolProfile. * Profile for the container service agent pool. * + * @extends ManagedClusterAgentPoolProfileProperties */ -export interface ManagedClusterAgentPoolProfile { +export interface ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { /** * @member {string} name Unique name of the agent pool profile in the context * of the subscription and resource group. */ name: string; +} + +/** + * @interface + * An interface representing AgentPool. + * Agent Pool. + * + * @extends SubResource + */ +export interface AgentPool extends SubResource { /** * @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 @@ -1006,11 +1168,23 @@ export interface ManagedClusterAgentPoolProfile { */ enableAutoScaling?: boolean; /** - * @member {AgentPoolType} [type] AgentPoolType represents types of an agent - * pool. Possible values include: 'VirtualMachineScaleSets', + * @member {AgentPoolType} [agentPoolType] AgentPoolType represents types of + * an agent pool. Possible values include: 'VirtualMachineScaleSets', * 'AvailabilitySet' */ - type?: AgentPoolType; + agentPoolType?: AgentPoolType; + /** + * @member {string} [orchestratorVersion] Version of orchestrator specified + * when creating the managed cluster. + */ + orchestratorVersion?: string; + /** + * @member {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly provisioningState?: string; } /** @@ -1463,6 +1637,23 @@ export interface ManagedClusterListResult extends Array { readonly nextLink?: string; } +/** + * @interface + * An interface representing the AgentPoolListResult. + * The response from the List Agent Pools operation. + * + * @extends Array + */ +export interface AgentPoolListResult extends Array { + /** + * @member {string} [nextLink] The URL to get the next set of agent pool + * results. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly nextLink?: string; +} + /** * Defines values for OSType. * Possible values include: 'Linux', 'Windows' @@ -2167,3 +2358,98 @@ export type ManagedClustersListByResourceGroupNextResponse = ManagedClusterListR parsedBody: ManagedClusterListResult; }; }; + +/** + * Contains response data for the list operation. + */ +export type AgentPoolsListResponse = AgentPoolListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AgentPoolListResult; + }; +}; + +/** + * Contains response data for the get operation. + */ +export type AgentPoolsGetResponse = AgentPool & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AgentPool; + }; +}; + +/** + * Contains response data for the createOrUpdate operation. + */ +export type AgentPoolsCreateOrUpdateResponse = AgentPool & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AgentPool; + }; +}; + +/** + * Contains response data for the beginCreateOrUpdate operation. + */ +export type AgentPoolsBeginCreateOrUpdateResponse = AgentPool & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AgentPool; + }; +}; + +/** + * Contains response data for the listNext operation. + */ +export type AgentPoolsListNextResponse = AgentPoolListResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: AgentPoolListResult; + }; +}; diff --git a/packages/@azure/arm-containerservice/lib/models/managedClustersMappers.ts b/packages/@azure/arm-containerservice/lib/models/managedClustersMappers.ts index acc4e6eff1fb..02330fb28496 100644 --- a/packages/@azure/arm-containerservice/lib/models/managedClustersMappers.ts +++ b/packages/@azure/arm-containerservice/lib/models/managedClustersMappers.ts @@ -15,6 +15,7 @@ export { Resource, BaseResource, ManagedClusterAgentPoolProfile, + ManagedClusterAgentPoolProfileProperties, ContainerServiceLinuxProfile, ContainerServiceSshConfiguration, ContainerServiceSshPublicKey, @@ -48,6 +49,8 @@ export { ContainerServiceAgentPoolProfile, ContainerServiceWindowsProfile, ContainerServiceDiagnosticsProfile, - ContainerServiceVMDiagnostics + ContainerServiceVMDiagnostics, + SubResource, + AgentPool } from "../models/mappers"; diff --git a/packages/@azure/arm-containerservice/lib/models/mappers.ts b/packages/@azure/arm-containerservice/lib/models/mappers.ts index 3c126ff84a24..43ef43a4a200 100644 --- a/packages/@azure/arm-containerservice/lib/models/mappers.ts +++ b/packages/@azure/arm-containerservice/lib/models/mappers.ts @@ -972,6 +972,37 @@ export const OperationValue: msRest.CompositeMapper = { } }; +export const SubResource: msRest.CompositeMapper = { + serializedName: "SubResource", + type: { + name: "Composite", + className: "SubResource", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + type: { + readOnly: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + export const ManagedClusterServicePrincipalProfile: msRest.CompositeMapper = { serializedName: "ManagedClusterServicePrincipalProfile", type: { @@ -995,19 +1026,12 @@ export const ManagedClusterServicePrincipalProfile: msRest.CompositeMapper = { } }; -export const ManagedClusterAgentPoolProfile: msRest.CompositeMapper = { - serializedName: "ManagedClusterAgentPoolProfile", +export const ManagedClusterAgentPoolProfileProperties: msRest.CompositeMapper = { + serializedName: "ManagedClusterAgentPoolProfileProperties", type: { name: "Composite", - className: "ManagedClusterAgentPoolProfile", + className: "ManagedClusterAgentPoolProfileProperties", modelProperties: { - name: { - required: true, - serializedName: "name", - type: { - name: "String" - } - }, count: { required: true, serializedName: "count", @@ -1075,6 +1099,129 @@ export const ManagedClusterAgentPoolProfile: msRest.CompositeMapper = { type: { name: "String" } + }, + orchestratorVersion: { + serializedName: "orchestratorVersion", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "provisioningState", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClusterAgentPoolProfile: msRest.CompositeMapper = { + serializedName: "ManagedClusterAgentPoolProfile", + type: { + name: "Composite", + className: "ManagedClusterAgentPoolProfile", + modelProperties: { + ...ManagedClusterAgentPoolProfileProperties.type.modelProperties, + name: { + required: true, + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + +export const AgentPool: msRest.CompositeMapper = { + serializedName: "AgentPool", + type: { + name: "Composite", + className: "AgentPool", + modelProperties: { + ...SubResource.type.modelProperties, + count: { + required: true, + serializedName: "properties.count", + defaultValue: 1, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 1 + }, + type: { + name: "Number" + } + }, + vmSize: { + required: true, + serializedName: "properties.vmSize", + type: { + name: "String" + } + }, + osDiskSizeGB: { + serializedName: "properties.osDiskSizeGB", + type: { + name: "Number" + } + }, + vnetSubnetID: { + serializedName: "properties.vnetSubnetID", + type: { + name: "String" + } + }, + maxPods: { + serializedName: "properties.maxPods", + type: { + name: "Number" + } + }, + osType: { + serializedName: "properties.osType", + defaultValue: 'Linux', + type: { + name: "String" + } + }, + maxCount: { + serializedName: "properties.maxCount", + type: { + name: "Number" + } + }, + minCount: { + serializedName: "properties.minCount", + type: { + name: "Number" + } + }, + enableAutoScaling: { + serializedName: "properties.enableAutoScaling", + type: { + name: "Boolean" + } + }, + agentPoolType: { + serializedName: "properties.type", + type: { + name: "String" + } + }, + orchestratorVersion: { + serializedName: "properties.orchestratorVersion", + type: { + name: "String" + } + }, + provisioningState: { + readOnly: true, + serializedName: "properties.provisioningState", + type: { + name: "String" + } } } } @@ -1689,6 +1836,35 @@ export const ManagedClusterListResult: msRest.CompositeMapper = { } }; +export const AgentPoolListResult: msRest.CompositeMapper = { + serializedName: "AgentPoolListResult", + type: { + name: "Composite", + className: "AgentPoolListResult", + modelProperties: { + value: { + serializedName: "", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AgentPool" + } + } + } + }, + nextLink: { + readOnly: true, + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const discriminators = { 'OpenShiftManagedClusterBaseIdentityProvider' : OpenShiftManagedClusterBaseIdentityProvider, 'OpenShiftManagedClusterBaseIdentityProvider.AADIdentityProvider' : OpenShiftManagedClusterAADIdentityProvider diff --git a/packages/@azure/arm-containerservice/lib/models/openShiftManagedClustersMappers.ts b/packages/@azure/arm-containerservice/lib/models/openShiftManagedClustersMappers.ts index 9efb41bb145f..266b3df3a254 100644 --- a/packages/@azure/arm-containerservice/lib/models/openShiftManagedClustersMappers.ts +++ b/packages/@azure/arm-containerservice/lib/models/openShiftManagedClustersMappers.ts @@ -38,8 +38,11 @@ export { ContainerServiceSshPublicKey, ContainerServiceDiagnosticsProfile, ContainerServiceVMDiagnostics, + SubResource, + AgentPool, ManagedCluster, ManagedClusterAgentPoolProfile, + ManagedClusterAgentPoolProfileProperties, ManagedClusterServicePrincipalProfile, ManagedClusterAddonProfile, ContainerServiceNetworkProfile, diff --git a/packages/@azure/arm-containerservice/lib/models/parameters.ts b/packages/@azure/arm-containerservice/lib/models/parameters.ts index 438a37b9639a..2b201be23c70 100644 --- a/packages/@azure/arm-containerservice/lib/models/parameters.ts +++ b/packages/@azure/arm-containerservice/lib/models/parameters.ts @@ -20,6 +20,16 @@ export const acceptLanguage: msRest.OperationParameter = { } } }; +export const agentPoolName: msRest.OperationURLParameter = { + parameterPath: "agentPoolName", + mapper: { + required: true, + serializedName: "agentPoolName", + type: { + name: "String" + } + } +}; export const apiVersion0: msRest.OperationQueryParameter = { parameterPath: "apiVersion", mapper: { @@ -62,7 +72,7 @@ export const apiVersion3: msRest.OperationQueryParameter = { required: true, isConstant: true, serializedName: "api-version", - defaultValue: '2018-08-01-preview', + defaultValue: '2019-02-01', type: { name: "String" } @@ -88,6 +98,16 @@ export const location: msRest.OperationURLParameter = { } } }; +export const managedClusterName: msRest.OperationURLParameter = { + parameterPath: "managedClusterName", + mapper: { + required: true, + serializedName: "managedClusterName", + type: { + name: "String" + } + } +}; export const nextPageLink: msRest.OperationURLParameter = { parameterPath: "nextPageLink", mapper: { diff --git a/packages/@azure/arm-containerservice/lib/operations/agentPools.ts b/packages/@azure/arm-containerservice/lib/operations/agentPools.ts new file mode 100644 index 000000000000..6ba4518d7505 --- /dev/null +++ b/packages/@azure/arm-containerservice/lib/operations/agentPools.ts @@ -0,0 +1,333 @@ +/* + * 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. + */ + +import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; +import * as Models from "../models"; +import * as Mappers from "../models/agentPoolsMappers"; +import * as Parameters from "../models/parameters"; +import { ContainerServiceClientContext } from "../containerServiceClientContext"; + +/** Class representing a AgentPools. */ +export class AgentPools { + private readonly client: ContainerServiceClientContext; + + /** + * Create a AgentPools. + * @param {ContainerServiceClientContext} client Reference to the service client. + */ + constructor(client: ContainerServiceClientContext) { + this.client = client; + } + + /** + * Gets a list of agent pools in the specified managed cluster. The operation returns properties of + * each agent pool. + * @summary Gets a list of agent pools in the specified managed cluster. + * @param managedClusterName The name of the managed cluster resource. + * @param [options] The optional parameters + * @returns Promise + */ + list(managedClusterName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param managedClusterName The name of the managed cluster resource. + * @param callback The callback + */ + list(managedClusterName: string, callback: msRest.ServiceCallback): void; + /** + * @param managedClusterName The name of the managed cluster resource. + * @param options The optional parameters + * @param callback The callback + */ + list(managedClusterName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + list(managedClusterName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + managedClusterName, + options + }, + listOperationSpec, + callback) as Promise; + } + + /** + * Gets the details of the agent pool by managed cluster and resource group. + * @summary Gets the agent pool. + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param [options] The optional parameters + * @returns Promise + */ + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param callback The callback + */ + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, callback: msRest.ServiceCallback): void; + /** + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param options The optional parameters + * @param callback The callback + */ + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + get(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + managedClusterName, + agentPoolName, + options + }, + getOperationSpec, + callback) as Promise; + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * @summary Creates or updates an agent pool. + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters Parameters supplied to the Create or Update an agent pool operation. + * @param [options] The optional parameters + * @returns Promise + */ + createOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: Models.AgentPool, options?: msRest.RequestOptionsBase): Promise { + return this.beginCreateOrUpdate(resourceGroupName,managedClusterName,agentPoolName,parameters,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Deletes the agent pool in the specified managed cluster. + * @summary Deletes an agent pool. + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param [options] The optional parameters + * @returns Promise + */ + deleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginDeleteMethod(resourceGroupName,managedClusterName,agentPoolName,options) + .then(lroPoller => lroPoller.pollUntilFinished()); + } + + /** + * Creates or updates an agent pool in the specified managed cluster. + * @summary Creates or updates an agent pool. + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param parameters Parameters supplied to the Create or Update an agent pool operation. + * @param [options] The optional parameters + * @returns Promise + */ + beginCreateOrUpdate(resourceGroupName: string, managedClusterName: string, agentPoolName: string, parameters: Models.AgentPool, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + managedClusterName, + agentPoolName, + parameters, + options + }, + beginCreateOrUpdateOperationSpec, + options); + } + + /** + * Deletes the agent pool in the specified managed cluster. + * @summary Deletes an agent pool. + * @param resourceGroupName The name of the resource group. + * @param managedClusterName The name of the managed cluster resource. + * @param agentPoolName The name of the agent pool. + * @param [options] The optional parameters + * @returns Promise + */ + beginDeleteMethod(resourceGroupName: string, managedClusterName: string, agentPoolName: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + resourceGroupName, + managedClusterName, + agentPoolName, + options + }, + beginDeleteMethodOperationSpec, + options); + } + + /** + * Gets a list of agent pools in the specified managed cluster. The operation returns properties of + * each agent pool. + * @summary Gets a list of agent pools in the specified managed cluster. + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param [options] The optional parameters + * @returns Promise + */ + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param callback The callback + */ + listNext(nextPageLink: string, callback: msRest.ServiceCallback): void; + /** + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param options The optional parameters + * @param callback The callback + */ + listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + nextPageLink, + options + }, + listNextOperationSpec, + callback) as Promise; + } +} + +// Operation Specifications +const serializer = new msRest.Serializer(Mappers); +const listOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools", + urlParameters: [ + Parameters.subscriptionId, + Parameters.managedClusterName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AgentPoolListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const getOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName0, + Parameters.managedClusterName, + Parameters.agentPoolName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AgentPool + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginCreateOrUpdateOperationSpec: msRest.OperationSpec = { + httpMethod: "PUT", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName0, + Parameters.managedClusterName, + Parameters.agentPoolName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "parameters", + mapper: { + ...Mappers.AgentPool, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.AgentPool + }, + 201: { + bodyMapper: Mappers.AgentPool + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const beginDeleteMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{managedClusterName}/agentPools/{agentPoolName}", + urlParameters: [ + Parameters.subscriptionId, + Parameters.resourceGroupName0, + Parameters.managedClusterName, + Parameters.agentPoolName + ], + queryParameters: [ + Parameters.apiVersion3 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; + +const listNextOperationSpec: msRest.OperationSpec = { + httpMethod: "GET", + baseUrl: "https://management.azure.com", + path: "{nextLink}", + urlParameters: [ + Parameters.nextPageLink + ], + headerParameters: [ + Parameters.acceptLanguage + ], + responses: { + 200: { + bodyMapper: Mappers.AgentPoolListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + serializer +}; diff --git a/packages/@azure/arm-containerservice/lib/operations/index.ts b/packages/@azure/arm-containerservice/lib/operations/index.ts index 6847d866f326..8d5b6c7986df 100644 --- a/packages/@azure/arm-containerservice/lib/operations/index.ts +++ b/packages/@azure/arm-containerservice/lib/operations/index.ts @@ -12,3 +12,4 @@ export * from "./openShiftManagedClusters"; export * from "./containerServices"; export * from "./operations"; export * from "./managedClusters"; +export * from "./agentPools";