diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index 670ca5b4812b..b521f762bfbc 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,15 +1,60 @@ # Release History -## 16.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +## 16.1.0-beta.1 (2022-05-06) + +**Features** + - Added operation group ManagedClusterSnapshots + - Added operation ManagedClusters.beginRotateServiceAccountSigningKeys + - Added operation ManagedClusters.beginRotateServiceAccountSigningKeysAndWait + - Added Interface AzureKeyVaultKms + - Added Interface ManagedClusterIngressProfile + - Added Interface ManagedClusterIngressProfileWebAppRouting + - Added Interface ManagedClusterOidcIssuerProfile + - Added Interface ManagedClusterPropertiesForSnapshot + - Added Interface ManagedClusterSecurityProfileWorkloadIdentity + - Added Interface ManagedClusterSnapshotListResult + - Added Interface ManagedClusterSnapshotsCreateOrUpdateOptionalParams + - Added Interface ManagedClusterSnapshotsDeleteOptionalParams + - Added Interface ManagedClusterSnapshotsGetOptionalParams + - Added Interface ManagedClusterSnapshotsListByResourceGroupNextOptionalParams + - Added Interface ManagedClusterSnapshotsListByResourceGroupOptionalParams + - Added Interface ManagedClusterSnapshotsListNextOptionalParams + - Added Interface ManagedClusterSnapshotsListOptionalParams + - Added Interface ManagedClusterSnapshotsUpdateTagsOptionalParams + - Added Interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams + - Added Interface NetworkProfileForSnapshot + - Added Type Alias ManagedClusterSnapshot + - Added Type Alias ManagedClusterSnapshotsCreateOrUpdateResponse + - Added Type Alias ManagedClusterSnapshotsGetResponse + - Added Type Alias ManagedClusterSnapshotsListByResourceGroupNextResponse + - Added Type Alias ManagedClusterSnapshotsListByResourceGroupResponse + - Added Type Alias ManagedClusterSnapshotsListNextResponse + - Added Type Alias ManagedClusterSnapshotsListResponse + - Added Type Alias ManagedClusterSnapshotsUpdateTagsResponse + - Interface AgentPoolsDeleteOptionalParams has a new optional parameter ignorePodDisruptionBudget + - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter capacityReservationGroupID + - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter currentOrchestratorVersion + - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter hostGroupID + - Interface ManagedClusterAgentPoolProfileProperties has a new optional parameter messageOfTheDay + - Interface ManagedClusterHttpProxyConfig has a new optional parameter effectiveNoProxy + - Interface ManagedClustersDeleteOptionalParams has a new optional parameter ignorePodDisruptionBudget + - Interface ManagedClusterSecurityProfile has a new optional parameter azureKeyVaultKms + - Interface ManagedClusterSecurityProfile has a new optional parameter workloadIdentity + - Interface ManagedClusterStorageProfileDiskCSIDriver has a new optional parameter version + - Class ContainerServiceClient has a new parameter managedClusterSnapshots + - Type Alias AgentPool has a new parameter messageOfTheDay + - Type Alias AgentPool has a new parameter currentOrchestratorVersion + - Type Alias AgentPool has a new parameter capacityReservationGroupID + - Type Alias AgentPool has a new parameter hostGroupID + - Type Alias ManagedCluster has a new parameter creationData + - Type Alias ManagedCluster has a new parameter currentKubernetesVersion + - Type Alias ManagedCluster has a new parameter oidcIssuerProfile + - Type Alias ManagedCluster has a new parameter enableNamespaceResources + - Type Alias ManagedCluster has a new parameter ingressProfile + - Enum KnownNetworkPlugin has a new value None + - Enum KnownSnapshotType has a new value ManagedCluster + ## 16.0.0 (2022-04-20) **Features** diff --git a/sdk/containerservice/arm-containerservice/README.md b/sdk/containerservice/arm-containerservice/README.md index e82804d19418..634b51c21adf 100644 --- a/sdk/containerservice/arm-containerservice/README.md +++ b/sdk/containerservice/arm-containerservice/README.md @@ -6,7 +6,7 @@ The Container Service Client. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-containerservice) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerservice) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index ca61735baa58..c0f0fa522199 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8a9bd9c5b65e5c3e5a8536f3c5b2b15bf9920b5d", + "commit": "63ecc4782618d9f20f3b1d9d0b5153d4cf4e45be", "readme": "specification/containerservice/resource-manager/readme.md", "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.0", "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/package.json b/sdk/containerservice/arm-containerservice/package.json index 17004477b417..0ba5dab77c35 100644 --- a/sdk/containerservice/arm-containerservice/package.json +++ b/sdk/containerservice/arm-containerservice/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerServiceClient.", - "version": "16.0.1", + "version": "16.1.0-beta.1", "engines": { "node": ">=12.0.0" }, diff --git a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md index 33fe2d37b10b..01db72d6f270 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -18,6 +18,7 @@ export type AgentPool = SubResource & { osDiskType?: OSDiskType; kubeletDiskType?: KubeletDiskType; workloadRuntime?: WorkloadRuntime; + messageOfTheDay?: string; vnetSubnetID?: string; podSubnetID?: string; maxPods?: number; @@ -30,6 +31,7 @@ export type AgentPool = SubResource & { typePropertiesType?: AgentPoolType; mode?: AgentPoolMode; orchestratorVersion?: string; + currentOrchestratorVersion?: string; readonly nodeImageVersion?: string; upgradeSettings?: AgentPoolUpgradeSettings; readonly provisioningState?: string; @@ -55,6 +57,8 @@ export type AgentPool = SubResource & { enableFips?: boolean; gpuInstanceProfile?: GPUInstanceProfile; creationData?: CreationData; + capacityReservationGroupID?: string; + hostGroupID?: string; }; // @public @@ -106,6 +110,7 @@ export type AgentPoolsCreateOrUpdateResponse = AgentPool; // @public export interface AgentPoolsDeleteOptionalParams extends coreClient.OperationOptions { + ignorePodDisruptionBudget?: boolean; resumeFrom?: string; updateIntervalInMs?: number; } @@ -181,6 +186,12 @@ export interface AgentPoolUpgradeSettings { maxSurge?: string; } +// @public +export interface AzureKeyVaultKms { + enabled?: boolean; + keyId?: string; +} + // @public export interface CloudError { error?: CloudErrorBody; @@ -214,6 +225,8 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // (undocumented) managedClusters: ManagedClusters; // (undocumented) + managedClusterSnapshots: ManagedClusterSnapshots; + // (undocumented) operations: Operations; // (undocumented) privateEndpointConnections: PrivateEndpointConnections; @@ -849,7 +862,8 @@ export enum KnownNetworkMode { // @public export enum KnownNetworkPlugin { Azure = "azure", - Kubenet = "kubenet" + Kubenet = "kubenet", + None = "none" } // @public @@ -926,6 +940,7 @@ export enum KnownScaleSetPriority { // @public export enum KnownSnapshotType { + ManagedCluster = "ManagedCluster", NodePool = "NodePool" } @@ -1054,8 +1069,10 @@ export type ManagedCluster = TrackedResource & { identity?: ManagedClusterIdentity; readonly provisioningState?: string; readonly powerState?: PowerState; + creationData?: CreationData; readonly maxAgentPools?: number; kubernetesVersion?: string; + readonly currentKubernetesVersion?: string; dnsPrefix?: string; fqdnSubdomain?: string; readonly fqdn?: string; @@ -1069,9 +1086,11 @@ export type ManagedCluster = TrackedResource & { [propertyName: string]: ManagedClusterAddonProfile; }; podIdentityProfile?: ManagedClusterPodIdentityProfile; + oidcIssuerProfile?: ManagedClusterOidcIssuerProfile; nodeResourceGroup?: string; enableRbac?: boolean; enablePodSecurityPolicy?: boolean; + enableNamespaceResources?: boolean; networkProfile?: ContainerServiceNetworkProfile; aadProfile?: ManagedClusterAADProfile; autoUpgradeProfile?: ManagedClusterAutoUpgradeProfile; @@ -1085,6 +1104,7 @@ export type ManagedCluster = TrackedResource & { disableLocalAccounts?: boolean; httpProxyConfig?: ManagedClusterHttpProxyConfig; securityProfile?: ManagedClusterSecurityProfile; + ingressProfile?: ManagedClusterIngressProfile; publicNetworkAccess?: PublicNetworkAccess; }; @@ -1124,19 +1144,23 @@ export type ManagedClusterAgentPoolProfile = ManagedClusterAgentPoolProfilePrope // @public export interface ManagedClusterAgentPoolProfileProperties { availabilityZones?: string[]; + capacityReservationGroupID?: string; count?: number; creationData?: CreationData; + currentOrchestratorVersion?: string; enableAutoScaling?: boolean; enableEncryptionAtHost?: boolean; enableFips?: boolean; enableNodePublicIP?: boolean; enableUltraSSD?: boolean; gpuInstanceProfile?: GPUInstanceProfile; + hostGroupID?: string; kubeletConfig?: KubeletConfig; kubeletDiskType?: KubeletDiskType; linuxOSConfig?: LinuxOSConfig; maxCount?: number; maxPods?: number; + messageOfTheDay?: string; minCount?: number; mode?: AgentPoolMode; readonly nodeImageVersion?: string; @@ -1184,6 +1208,7 @@ export interface ManagedClusterAutoUpgradeProfile { // @public export interface ManagedClusterHttpProxyConfig { + readonly effectiveNoProxy?: string[]; httpProxy?: string; httpsProxy?: string; noProxy?: string[]; @@ -1200,6 +1225,17 @@ export interface ManagedClusterIdentity { }; } +// @public +export interface ManagedClusterIngressProfile { + webAppRouting?: ManagedClusterIngressProfileWebAppRouting; +} + +// @public +export interface ManagedClusterIngressProfileWebAppRouting { + dnsZoneResourceId?: string; + enabled?: boolean; +} + // @public export interface ManagedClusterListResult { readonly nextLink?: string; @@ -1245,6 +1281,12 @@ export interface ManagedClusterNATGatewayProfile { managedOutboundIPProfile?: ManagedClusterManagedOutboundIPProfile; } +// @public +export interface ManagedClusterOidcIssuerProfile { + enabled?: boolean; + readonly issuerURL?: string; +} + // @public export interface ManagedClusterPodIdentity { bindingSelector?: string; @@ -1328,6 +1370,14 @@ export interface ManagedClusterPropertiesAutoScalerProfile { skipNodesWithSystemPods?: string; } +// @public +export interface ManagedClusterPropertiesForSnapshot { + enableRbac?: boolean; + kubernetesVersion?: string; + readonly networkProfile?: NetworkProfileForSnapshot; + sku?: ManagedClusterSKU; +} + // @public export interface ManagedClusters { beginCreateOrUpdate(resourceGroupName: string, resourceName: string, parameters: ManagedCluster, options?: ManagedClustersCreateOrUpdateOptionalParams): Promise, ManagedClustersCreateOrUpdateResponse>>; @@ -1340,6 +1390,8 @@ export interface ManagedClusters { beginResetServicePrincipalProfileAndWait(resourceGroupName: string, resourceName: string, parameters: ManagedClusterServicePrincipalProfile, options?: ManagedClustersResetServicePrincipalProfileOptionalParams): Promise; beginRotateClusterCertificates(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise, void>>; beginRotateClusterCertificatesAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams): Promise; + beginRotateServiceAccountSigningKeys(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise, void>>; + beginRotateServiceAccountSigningKeysAndWait(resourceGroupName: string, resourceName: string, options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams): Promise; beginRunCommand(resourceGroupName: string, resourceName: string, requestPayload: RunCommandRequest, options?: ManagedClustersRunCommandOptionalParams): Promise, ManagedClustersRunCommandResponse>>; beginRunCommandAndWait(resourceGroupName: string, resourceName: string, requestPayload: RunCommandRequest, options?: ManagedClustersRunCommandOptionalParams): Promise; beginStart(resourceGroupName: string, resourceName: string, options?: ManagedClustersStartOptionalParams): Promise, void>>; @@ -1372,6 +1424,7 @@ export type ManagedClustersCreateOrUpdateResponse = ManagedCluster; // @public export interface ManagedClustersDeleteOptionalParams extends coreClient.OperationOptions { + ignorePodDisruptionBudget?: boolean; resumeFrom?: string; updateIntervalInMs?: number; } @@ -1379,6 +1432,8 @@ export interface ManagedClustersDeleteOptionalParams extends coreClient.Operatio // @public export interface ManagedClusterSecurityProfile { azureDefender?: ManagedClusterSecurityProfileAzureDefender; + azureKeyVaultKms?: AzureKeyVaultKms; + workloadIdentity?: ManagedClusterSecurityProfileWorkloadIdentity; } // @public @@ -1387,6 +1442,11 @@ export interface ManagedClusterSecurityProfileAzureDefender { logAnalyticsWorkspaceResourceId?: string; } +// @public +export interface ManagedClusterSecurityProfileWorkloadIdentity { + enabled?: boolean; +} + // @public export interface ManagedClusterServicePrincipalProfile { clientId: string; @@ -1508,6 +1568,82 @@ export type ManagedClustersListOutboundNetworkDependenciesEndpointsResponse = Ou // @public export type ManagedClustersListResponse = ManagedClusterListResult; +// @public +export type ManagedClusterSnapshot = TrackedResource & { + creationData?: CreationData; + snapshotType?: SnapshotType; + readonly managedClusterPropertiesReadOnly?: ManagedClusterPropertiesForSnapshot; +}; + +// @public +export interface ManagedClusterSnapshotListResult { + readonly nextLink?: string; + value?: ManagedClusterSnapshot[]; +} + +// @public +export interface ManagedClusterSnapshots { + createOrUpdate(resourceGroupName: string, resourceName: string, parameters: ManagedClusterSnapshot, options?: ManagedClusterSnapshotsCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, resourceName: string, options?: ManagedClusterSnapshotsDeleteOptionalParams): Promise; + get(resourceGroupName: string, resourceName: string, options?: ManagedClusterSnapshotsGetOptionalParams): Promise; + list(options?: ManagedClusterSnapshotsListOptionalParams): PagedAsyncIterableIterator; + listByResourceGroup(resourceGroupName: string, options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + updateTags(resourceGroupName: string, resourceName: string, parameters: TagsObject, options?: ManagedClusterSnapshotsUpdateTagsOptionalParams): Promise; +} + +// @public +export interface ManagedClusterSnapshotsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsCreateOrUpdateResponse = ManagedClusterSnapshot; + +// @public +export interface ManagedClusterSnapshotsDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface ManagedClusterSnapshotsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsGetResponse = ManagedClusterSnapshot; + +// @public +export interface ManagedClusterSnapshotsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsListByResourceGroupNextResponse = ManagedClusterSnapshotListResult; + +// @public +export interface ManagedClusterSnapshotsListByResourceGroupOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsListByResourceGroupResponse = ManagedClusterSnapshotListResult; + +// @public +export interface ManagedClusterSnapshotsListNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsListNextResponse = ManagedClusterSnapshotListResult; + +// @public +export interface ManagedClusterSnapshotsListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsListResponse = ManagedClusterSnapshotListResult; + +// @public +export interface ManagedClusterSnapshotsUpdateTagsOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type ManagedClusterSnapshotsUpdateTagsResponse = ManagedClusterSnapshot; + // @public export interface ManagedClustersResetAADProfileOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1526,6 +1662,12 @@ export interface ManagedClustersRotateClusterCertificatesOptionalParams extends updateIntervalInMs?: number; } +// @public +export interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface ManagedClustersRunCommandOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1557,6 +1699,7 @@ export interface ManagedClusterStorageProfile { // @public export interface ManagedClusterStorageProfileDiskCSIDriver { enabled?: boolean; + version?: string; } // @public @@ -1611,6 +1754,14 @@ export type NetworkPlugin = string; // @public export type NetworkPolicy = string; +// @public +export interface NetworkProfileForSnapshot { + loadBalancerSku?: LoadBalancerSku; + networkMode?: NetworkMode; + networkPlugin?: NetworkPlugin; + networkPolicy?: NetworkPolicy; +} + // @public export interface OperationListResult { readonly value?: OperationValue[]; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts index 58fedd17f05d..7003e928438a 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts @@ -15,7 +15,39 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Snapshot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json + */ +async function associateAgentPoolWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1", + count: 3, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +associateAgentPoolWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Snapshot.json */ async function createAgentPoolUsingAnAgentPoolSnapshot() { const subscriptionId = "subid1"; @@ -50,7 +82,39 @@ createAgentPoolUsingAnAgentPoolSnapshot().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json + */ +async function createAgentPoolWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json */ async function createAgentPoolWithEncryptionAtHostEnabled() { const subscriptionId = "subid1"; @@ -81,7 +145,7 @@ createAgentPoolWithEncryptionAtHostEnabled().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Ephemeral.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Ephemeral.json */ async function createAgentPoolWithEphemeralOSDisk() { const subscriptionId = "subid1"; @@ -113,7 +177,7 @@ createAgentPoolWithEphemeralOSDisk().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableFIPS.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableFIPS.json */ async function createAgentPoolWithFipsEnabledOS() { const subscriptionId = "subid1"; @@ -144,7 +208,7 @@ createAgentPoolWithFipsEnabledOS().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_GPUMIG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_GPUMIG.json */ async function createAgentPoolWithGpumig() { const subscriptionId = "subid1"; @@ -196,7 +260,7 @@ createAgentPoolWithGpumig().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_WasmWasi.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_WasmWasi.json */ async function createAgentPoolWithKrustletAndTheWasiRuntime() { const subscriptionId = "subid1"; @@ -229,7 +293,7 @@ createAgentPoolWithKrustletAndTheWasiRuntime().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_CustomNodeConfig.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json */ async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { const subscriptionId = "subid1"; @@ -280,7 +344,40 @@ createAgentPoolWithKubeletConfigAndLinuxOSConfig().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_OSSKU.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json + */ +async function createAgentPoolWithMessageOfTheDay() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + messageOfTheDay: "Zm9vCg==", + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithMessageOfTheDay().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_OSSKU.json */ async function createAgentPoolWithOssku() { const subscriptionId = "subid1"; @@ -332,7 +429,7 @@ createAgentPoolWithOssku().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_PPG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_PPG.json */ async function createAgentPoolWithPpg() { const subscriptionId = "subid1"; @@ -364,7 +461,7 @@ createAgentPoolWithPpg().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableUltraSSD.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json */ async function createAgentPoolWithUltraSsdEnabled() { const subscriptionId = "subid1"; @@ -395,7 +492,7 @@ createAgentPoolWithUltraSsdEnabled().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Spot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Spot.json */ async function createSpotAgentPool() { const subscriptionId = "subid1"; @@ -430,7 +527,7 @@ createSpotAgentPool().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Update.json */ async function createOrUpdateAgentPool() { const subscriptionId = "subid1"; @@ -466,7 +563,7 @@ createOrUpdateAgentPool().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPools_Start.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Start.json */ async function startAgentPool() { const subscriptionId = "subid1"; @@ -491,7 +588,7 @@ startAgentPool().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPools_Stop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Stop.json */ async function stopAgentPool() { const subscriptionId = "subid1"; @@ -516,7 +613,7 @@ stopAgentPool().catch(console.error); * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. * * @summary Creates or updates an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPools_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Update.json */ async function updateAgentPool() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsDeleteSample.ts index 396a0b209b5d..c47f40aaec27 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsDeleteSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsDeleteSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. * * @summary Deletes an agent pool in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json */ async function deleteAgentPool() { const subscriptionId = "subid1"; @@ -33,3 +33,26 @@ async function deleteAgentPool() { } deleteAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json + */ +async function deleteAgentPoolByIgnoringPodDisruptionBudget() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPoolByIgnoringPodDisruptionBudget().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts index 115f5a5f34cb..facb4a7c82ef 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. * * @summary See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json */ async function getAvailableVersionsForAgentPool() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetSample.ts index 75f4c4a6d5ca..811aef2b4585 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the specified managed cluster agent pool. * * @summary Gets the specified managed cluster agent pool. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json */ async function getAgentPool() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetUpgradeProfileSample.ts index 46262c70e617..0f8327a4d89f 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetUpgradeProfileSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetUpgradeProfileSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the upgrade profile for an agent pool. * * @summary Gets the upgrade profile for an agent pool. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsGetUpgradeProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json */ async function getUpgradeProfileForAgentPool() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsListSample.ts index 81098e5cd6bd..9a3c03bdbc8e 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of agent pools in the specified managed cluster. * * @summary Gets a list of agent pools in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json */ async function listAgentPoolsByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsUpgradeNodeImageVersionSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsUpgradeNodeImageVersionSample.ts index dc3ab15f3a11..127826f80145 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsUpgradeNodeImageVersionSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsUpgradeNodeImageVersionSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade * * @summary Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsUpgradeNodeImageVersion.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json */ async function upgradeAgentPoolNodeImageVersion() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsCreateOrUpdateSample.ts index 537f5add6c4f..7cf14ecdfbad 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates a maintenance configuration in the specified managed cluster. * * @summary Creates or updates a maintenance configuration in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/MaintenanceConfigurationsCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json */ async function createOrUpdateMaintenanceConfiguration() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsDeleteSample.ts index c116255eeb32..124b8c218cef 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsDeleteSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsDeleteSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes a maintenance configuration. * * @summary Deletes a maintenance configuration. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/MaintenanceConfigurationsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json */ async function deleteMaintenanceConfiguration() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsGetSample.ts index d91f9c861c22..8b7da3fbd57a 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsGetSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsGetSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the specified maintenance configuration of a managed cluster. * * @summary Gets the specified maintenance configuration of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/MaintenanceConfigurationsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json */ async function getMaintenanceConfiguration() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsListByManagedClusterSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsListByManagedClusterSample.ts index b502675c22c0..b36a0fc95aa2 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsListByManagedClusterSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/maintenanceConfigurationsListByManagedClusterSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of maintenance configurations in the specified managed cluster. * * @summary Gets a list of maintenance configurations in the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/MaintenanceConfigurationsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json */ async function listMaintenanceConfigurationsByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..05d978e6cdf6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ManagedClusterSnapshot, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a managed cluster snapshot. + * + * @summary Creates or updates a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json + */ +async function createOrUpdateManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: ManagedClusterSnapshot = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1" + }, + location: "westus", + tags: { key1: "val1", key2: "val2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.createOrUpdate( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsDeleteSample.ts new file mode 100644 index 000000000000..15fda4caf71c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a managed cluster snapshot. + * + * @summary Deletes a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json + */ +async function deleteManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.delete( + resourceGroupName, + resourceName + ); + console.log(result); +} + +deleteManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsGetSample.ts new file mode 100644 index 000000000000..8bd0b216e15b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a managed cluster snapshot. + * + * @summary Gets a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json + */ +async function getManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.get( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..587f6fea5877 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists managed cluster snapshots in the specified subscription and resource group. + * + * @summary Lists managed cluster snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json + */ +async function listManagedClusterSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListSample.ts new file mode 100644 index 000000000000..d87223470e31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of managed cluster snapshots in the specified subscription. + * + * @summary Gets a list of managed cluster snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json + */ +async function listManagedClusterSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsUpdateTagsSample.ts new file mode 100644 index 000000000000..45c64b81b9d7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClusterSnapshotsUpdateTagsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates tags on a managed cluster snapshot. + * + * @summary Updates tags on a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json + */ +async function updateManagedClusterSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: TagsObject = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.updateTags( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts index e8e6fd626b3f..92cc04a789a2 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts @@ -18,7 +18,119 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Snapshot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json + */ +async function associateManagedClusterWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +associateManagedClusterWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_MCSnapshot.json + */ +async function createManagedClusterUsingAManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1" + }, + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAManagedClusterSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Snapshot.json */ async function createManagedClusterUsingAnAgentPoolSnapshot() { const subscriptionId = "subid1"; @@ -83,7 +195,7 @@ createManagedClusterUsingAnAgentPoolSnapshot().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_ManagedNATGateway.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json */ async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { const subscriptionId = "subid1"; @@ -145,7 +257,68 @@ createManagedClusterWithAksManagedNatGatewayAsOutboundType().catch( * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json + */ +async function createManagedClusterWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json */ async function createManagedClusterWithEncryptionAtHostEnabled() { const subscriptionId = "subid1"; @@ -206,7 +379,7 @@ createManagedClusterWithEncryptionAtHostEnabled().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnabledFIPS.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json */ async function createManagedClusterWithFipsEnabledOS() { const subscriptionId = "subid1"; @@ -267,7 +440,7 @@ createManagedClusterWithFipsEnabledOS().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_GPUMIG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_GPUMIG.json */ async function createManagedClusterWithGpumig() { const subscriptionId = "subid1"; @@ -334,7 +507,7 @@ createManagedClusterWithGpumig().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_HTTPProxy.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_HTTPProxy.json */ async function createManagedClusterWithHttpProxyConfigured() { const subscriptionId = "subid1"; @@ -400,7 +573,7 @@ createManagedClusterWithHttpProxyConfigured().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json */ async function createManagedClusterWithNodePublicIPPrefix() { const subscriptionId = "subid1"; @@ -462,7 +635,7 @@ createManagedClusterWithNodePublicIPPrefix().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_OSSKU.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_OSSKU.json */ async function createManagedClusterWithOssku() { const subscriptionId = "subid1"; @@ -529,7 +702,7 @@ createManagedClusterWithOssku().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PPG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PPG.json */ async function createManagedClusterWithPpg() { const subscriptionId = "subid1"; @@ -591,7 +764,7 @@ createManagedClusterWithPpg().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PodIdentity.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PodIdentity.json */ async function createManagedClusterWithPodIdentityEnabled() { const subscriptionId = "subid1"; @@ -652,7 +825,7 @@ createManagedClusterWithPodIdentityEnabled().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_DisableRunCommand.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json */ async function createManagedClusterWithRunCommandDisabled() { const subscriptionId = "subid1"; @@ -712,7 +885,7 @@ createManagedClusterWithRunCommandDisabled().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_SecurityProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_SecurityProfile.json */ async function createManagedClusterWithSecurityProfileConfigured() { const subscriptionId = "subid1"; @@ -768,7 +941,7 @@ createManagedClusterWithSecurityProfileConfigured().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnableUltraSSD.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json */ async function createManagedClusterWithUltraSsdEnabled() { const subscriptionId = "subid1"; @@ -829,7 +1002,65 @@ createManagedClusterWithUltraSsdEnabled().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ +async function createManagedClusterWithWebAppRoutingIngressProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + dnsPrefix: "dnsprefix1", + ingressProfile: { + webAppRouting: { + dnsZoneResourceId: + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME", + enabled: true + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithWebAppRoutingIngressProfileConfigured().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json */ async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { const subscriptionId = "subid1"; @@ -890,7 +1121,7 @@ createManagedClusterWithUserAssignedNatGatewayAsOutboundType().catch( * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json */ async function createManagedPrivateClusterWithPublicFqdnSpecified() { const subscriptionId = "subid1"; @@ -953,7 +1184,7 @@ createManagedPrivateClusterWithPublicFqdnSpecified().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json */ async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { const subscriptionId = "subid1"; @@ -1017,7 +1248,7 @@ createManagedPrivateClusterWithFqdnSubdomainSpecified().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json */ async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { const subscriptionId = "subid1"; @@ -1079,7 +1310,7 @@ createOrUpdateAadManagedClusterWithEnableAzureRbac().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Update.json */ async function createOrUpdateManagedCluster() { const subscriptionId = "subid1"; @@ -1155,7 +1386,7 @@ createOrUpdateManagedCluster().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json */ async function createOrUpdateManagedClusterWithEnableAhub() { const subscriptionId = "subid1"; @@ -1223,7 +1454,69 @@ createOrUpdateManagedClusterWithEnableAhub().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json + */ +async function createOrUpdateManagedClusterWithEnableNamespaceResources() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enableNamespaceResources: true, + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableNamespaceResources().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json */ async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { const subscriptionId = "subid1"; @@ -1291,7 +1584,7 @@ createOrUpdateManagedClusterWithWindowsGMsaEnabled().catch(console.error); * This sample demonstrates how to Creates or updates a managed cluster. * * @summary Creates or updates a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_DualStackNetworking.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json */ async function createOrUpdateManagedClusterWithDualStackNetworking() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersDeleteSample.ts index b51710aa586e..827fb080a3d0 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersDeleteSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersDeleteSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes a managed cluster. * * @summary Deletes a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json */ async function deleteManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetAccessProfileSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetAccessProfileSample.ts index 0c1a617e9ab5..230da6c17e69 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetAccessProfileSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetAccessProfileSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . * * @summary **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersGetAccessProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json */ async function getManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetCommandResultSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetCommandResultSample.ts index 0026f19b615b..85a22291d263 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetCommandResultSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetCommandResultSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. * * @summary Gets the results of a command which has been run on the Managed Cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/RunCommandResultFailed.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json */ async function commandFailedResult() { const subscriptionId = "subid1"; @@ -38,7 +38,7 @@ commandFailedResult().catch(console.error); * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. * * @summary Gets the results of a command which has been run on the Managed Cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/RunCommandResultSucceed.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultSucceed.json */ async function commandSucceedResult() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetOSOptionsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetOSOptionsSample.ts index 3b777c150258..9cb65eb831b7 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetOSOptionsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetOSOptionsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets supported OS options in the specified subscription. * * @summary Gets supported OS options in the specified subscription. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ContainerServiceGetOSOptions.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json */ async function getContainerServiceOSOptions() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetSample.ts index d8306bfe7565..4ce0262330f8 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a managed cluster. * * @summary Gets a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json */ async function getManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetUpgradeProfileSample.ts index 3df430890cae..adc996cb3720 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetUpgradeProfileSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersGetUpgradeProfileSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the upgrade profile of a managed cluster. * * @summary Gets the upgrade profile of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersGetUpgradeProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json */ async function getUpgradeProfileForManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListByResourceGroupSample.ts index 915a40844662..98c996b33f7b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListByResourceGroupSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListByResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Lists managed clusters in the specified subscription and resource group. * * @summary Lists managed clusters in the specified subscription and resource group. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json */ async function getManagedClustersByResourceGroup() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterAdminCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterAdminCredentialsSample.ts index f5bedc881559..ac76c5cfb484 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterAdminCredentialsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterAdminCredentialsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Lists the admin credentials of a managed cluster. * * @summary Lists the admin credentials of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json */ async function getManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterMonitoringUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterMonitoringUserCredentialsSample.ts index 858c00c20cdf..60d8c6858b9d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterMonitoringUserCredentialsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterMonitoringUserCredentialsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Lists the cluster monitoring user credentials of a managed cluster. * * @summary Lists the cluster monitoring user credentials of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json */ async function getManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterUserCredentialsSample.ts index a73280e33673..7efed75eaf87 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterUserCredentialsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListClusterUserCredentialsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Lists the user credentials of a managed cluster. * * @summary Lists the user credentials of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json */ async function getManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts index 5d0a98a64bb9..806a62f7022b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. * * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/OutboundNetworkDependenciesEndpointsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json */ async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListSample.ts index 391c7504ca32..d6b05fd3dc7d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of managed clusters in the specified subscription. * * @summary Gets a list of managed clusters in the specified subscription. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json */ async function listManagedClusters() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetAadProfileSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetAadProfileSample.ts index 5d8ff496b76f..ef2925b7f302 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetAadProfileSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetAadProfileSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Reset the AAD Profile of a managed cluster. * * @summary Reset the AAD Profile of a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersResetAADProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json */ async function resetAadProfile() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetServicePrincipalProfileSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetServicePrincipalProfileSample.ts index 9d25266e6f4c..f623b7fb8a3d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetServicePrincipalProfileSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersResetServicePrincipalProfileSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to This action cannot be performed on a cluster that is not using a service principal * * @summary This action cannot be performed on a cluster that is not using a service principal - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersResetServicePrincipalProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json */ async function resetServicePrincipalProfile() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateClusterCertificatesSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateClusterCertificatesSample.ts index a2aa4e730e76..9c5a1726c413 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateClusterCertificatesSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateClusterCertificatesSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. * * @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersRotateClusterCertificates.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json */ async function rotateClusterCertificates() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateServiceAccountSigningKeysSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateServiceAccountSigningKeysSample.ts new file mode 100644 index 000000000000..9f82530282cd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRotateServiceAccountSigningKeysSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Rotates the service account signing keys of a managed cluster. + * + * @summary Rotates the service account signing keys of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json + */ +async function rotateClusterServiceAccountSigningKeys() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateServiceAccountSigningKeysAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterServiceAccountSigningKeys().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts index 4003085b7458..05b21eac6a5e 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). * * @summary AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/RunCommandRequest.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json */ async function submitNewCommand() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStartSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStartSample.ts index 603ec4bac8a9..02c7a298052b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStartSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStartSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. * * @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersStart.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json */ async function startManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStopSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStopSample.ts index edd4387a2f6e..3ce68d5bdbe7 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStopSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersStopSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. * * @summary This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersStop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json */ async function stopManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersUpdateTagsSample.ts index 4da15c175c31..b4dc51ccee8d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersUpdateTagsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersUpdateTagsSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Updates tags on a managed cluster. * * @summary Updates tags on a managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersUpdateTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json */ async function updateManagedClusterTags() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/operationsListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/operationsListSample.ts index d6bbf405fb93..945b99ec7e65 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/operationsListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/operationsListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of operations. * * @summary Gets a list of operations. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/Operation_List.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json */ async function listAvailableOperationsForTheContainerServiceResourceProvider() { const subscriptionId = "00000000-0000-0000-0000-000000000000"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsDeleteSample.ts index 382657bf81ff..522255eafbc0 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes a private endpoint connection. * * @summary Deletes a private endpoint connection. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/PrivateEndpointConnectionsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json */ async function deletePrivateEndpointConnection() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsGetSample.ts index 83ad56405d17..7cc424e132af 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsGetSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters * * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/PrivateEndpointConnectionsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json */ async function getPrivateEndpointConnection() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsListSample.ts index 0eadd58955fc..490a04b3af1c 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters * * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json */ async function listPrivateEndpointConnectionsByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsUpdateSample.ts index 952bd66abaaa..a12cbf44880c 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/privateEndpointConnectionsUpdateSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Updates a private endpoint connection. * * @summary Updates a private endpoint connection. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/PrivateEndpointConnectionsUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json */ async function updatePrivateEndpointConnection() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/privateLinkResourcesListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/privateLinkResourcesListSample.ts index 9b54caef58f8..f6e517bd5e4d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/privateLinkResourcesListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/privateLinkResourcesListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters * * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json */ async function listPrivateLinkResourcesByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/resolvePrivateLinkServiceIdPostSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/resolvePrivateLinkServiceIdPostSample.ts index d22b82b02762..263a83b2233b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/resolvePrivateLinkServiceIdPostSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/resolvePrivateLinkServiceIdPostSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets the private link service ID for the specified managed cluster. * * @summary Gets the private link service ID for the specified managed cluster. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ResolvePrivateLinkServiceId.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json */ async function resolveThePrivateLinkServiceIdForManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsCreateOrUpdateSample.ts index f7585ccb5d92..d1e84753866b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsCreateOrUpdateSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Creates or updates a snapshot. * * @summary Creates or updates a snapshot. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsCreate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json */ async function createOrUpdateSnapshot() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsDeleteSample.ts index e4f439808be9..762f0dfd1057 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsDeleteSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsDeleteSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Deletes a snapshot. * * @summary Deletes a snapshot. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json */ async function deleteSnapshot() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsGetSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsGetSample.ts index 47074edc1596..82bff84c6c76 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsGetSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsGetSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a snapshot. * * @summary Gets a snapshot. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json */ async function getSnapshot() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListByResourceGroupSample.ts index c99508f1d098..4fd50e410181 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListByResourceGroupSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListByResourceGroupSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Lists snapshots in the specified subscription and resource group. * * @summary Lists snapshots in the specified subscription and resource group. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json */ async function listSnapshotsByResourceGroup() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListSample.ts index 8237cb7e4ee2..bcdf22f842d4 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsListSample.ts @@ -15,7 +15,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Gets a list of snapshots in the specified subscription. * * @summary Gets a list of snapshots in the specified subscription. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json */ async function listSnapshots() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsUpdateTagsSample.ts index 53cccd577d4a..0bbcad3d876b 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/snapshotsUpdateTagsSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/snapshotsUpdateTagsSample.ts @@ -18,7 +18,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to Updates tags on a snapshot. * * @summary Updates tags on a snapshot. - * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsUpdateTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json */ async function updateSnapshotTags() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/README.md b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/README.md new file mode 100644 index 000000000000..faf3361c4eb7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/README.md @@ -0,0 +1,300 @@ +# client library samples for JavaScript (Beta) + +These sample programs show how to use the JavaScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [agentPoolsCreateOrUpdateSample.js][agentpoolscreateorupdatesample] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json | +| [agentPoolsDeleteSample.js][agentpoolsdeletesample] | Deletes an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json | +| [agentPoolsGetAvailableAgentPoolVersionsSample.js][agentpoolsgetavailableagentpoolversionssample] | See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [agentPoolsGetSample.js][agentpoolsgetsample] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json | +| [agentPoolsGetUpgradeProfileSample.js][agentpoolsgetupgradeprofilesample] | Gets the upgrade profile for an agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json | +| [agentPoolsListSample.js][agentpoolslistsample] | Gets a list of agent pools in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json | +| [agentPoolsUpgradeNodeImageVersionSample.js][agentpoolsupgradenodeimageversionsample] | Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json | +| [commandFailedResult.js][commandfailedresult] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultFailed.json | +| [commandSucceedResult.js][commandsucceedresult] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultSucceed.json | +| [createAgentPoolUsingAnAgentPoolSnapshot.js][createagentpoolusinganagentpoolsnapshot] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Snapshot.json | +| [createAgentPoolWithEncryptionAtHostEnabled.js][createagentpoolwithencryptionathostenabled] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json | +| [createAgentPoolWithEphemeralOSDisk.js][createagentpoolwithephemeralosdisk] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Ephemeral.json | +| [createAgentPoolWithFipsEnabledOS.js][createagentpoolwithfipsenabledos] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableFIPS.json | +| [createAgentPoolWithGpumig.js][createagentpoolwithgpumig] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_GPUMIG.json | +| [createAgentPoolWithKrustletAndTheWasiRuntime.js][createagentpoolwithkrustletandthewasiruntime] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_WasmWasi.json | +| [createAgentPoolWithKubeletConfigAndLinuxOSConfig.js][createagentpoolwithkubeletconfigandlinuxosconfig] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_CustomNodeConfig.json | +| [createAgentPoolWithOssku.js][createagentpoolwithossku] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_OSSKU.json | +| [createAgentPoolWithPpg.js][createagentpoolwithppg] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_PPG.json | +| [createAgentPoolWithUltraSsdEnabled.js][createagentpoolwithultrassdenabled] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableUltraSSD.json | +| [createManagedClusterUsingAnAgentPoolSnapshot.js][createmanagedclusterusinganagentpoolsnapshot] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Snapshot.json | +| [createManagedClusterWithAksManagedNatGatewayAsOutboundType.js][createmanagedclusterwithaksmanagednatgatewayasoutboundtype] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_ManagedNATGateway.json | +| [createManagedClusterWithEncryptionAtHostEnabled.js][createmanagedclusterwithencryptionathostenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json | +| [createManagedClusterWithFipsEnabledOS.js][createmanagedclusterwithfipsenabledos] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnabledFIPS.json | +| [createManagedClusterWithGpumig.js][createmanagedclusterwithgpumig] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_GPUMIG.json | +| [createManagedClusterWithHttpProxyConfigured.js][createmanagedclusterwithhttpproxyconfigured] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_HTTPProxy.json | +| [createManagedClusterWithNodePublicIPPrefix.js][createmanagedclusterwithnodepublicipprefix] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json | +| [createManagedClusterWithOssku.js][createmanagedclusterwithossku] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_OSSKU.json | +| [createManagedClusterWithPodIdentityEnabled.js][createmanagedclusterwithpodidentityenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PodIdentity.json | +| [createManagedClusterWithPpg.js][createmanagedclusterwithppg] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PPG.json | +| [createManagedClusterWithRunCommandDisabled.js][createmanagedclusterwithruncommanddisabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DisableRunCommand.json | +| [createManagedClusterWithSecurityProfileConfigured.js][createmanagedclusterwithsecurityprofileconfigured] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_SecurityProfile.json | +| [createManagedClusterWithUltraSsdEnabled.js][createmanagedclusterwithultrassdenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableUltraSSD.json | +| [createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js][createmanagedclusterwithuserassignednatgatewayasoutboundtype] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json | +| [createManagedPrivateClusterWithFqdnSubdomainSpecified.js][createmanagedprivateclusterwithfqdnsubdomainspecified] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json | +| [createManagedPrivateClusterWithPublicFqdnSpecified.js][createmanagedprivateclusterwithpublicfqdnspecified] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json | +| [createOrUpdateAadManagedClusterWithEnableAzureRbac.js][createorupdateaadmanagedclusterwithenableazurerbac] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json | +| [createOrUpdateAgentPool.js][createorupdateagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Update.json | +| [createOrUpdateMaintenanceConfiguration.js][createorupdatemaintenanceconfiguration] | Creates or updates a maintenance configuration in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsCreate_Update.json | +| [createOrUpdateManagedCluster.js][createorupdatemanagedcluster] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Update.json | +| [createOrUpdateManagedClusterWithDualStackNetworking.js][createorupdatemanagedclusterwithdualstacknetworking] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DualStackNetworking.json | +| [createOrUpdateManagedClusterWithEnableAhub.js][createorupdatemanagedclusterwithenableahub] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithAHUB.json | +| [createOrUpdateManagedClusterWithWindowsGMsaEnabled.js][createorupdatemanagedclusterwithwindowsgmsaenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json | +| [createOrUpdateSnapshot.js][createorupdatesnapshot] | Creates or updates a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsCreate.json | +| [createSpotAgentPool.js][createspotagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Spot.json | +| [deleteAgentPool.js][deleteagentpool] | Deletes an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsDelete.json | +| [deleteMaintenanceConfiguration.js][deletemaintenanceconfiguration] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsDelete.json | +| [deleteManagedCluster.js][deletemanagedcluster] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersDelete.json | +| [deletePrivateEndpointConnection.js][deleteprivateendpointconnection] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsDelete.json | +| [deleteSnapshot.js][deletesnapshot] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsDelete.json | +| [getAgentPool.js][getagentpool] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGet.json | +| [getAvailableVersionsForAgentPool.js][getavailableversionsforagentpool] | See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [getContainerServiceOSOptions.js][getcontainerserviceosoptions] | Gets supported OS options in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ContainerServiceGetOSOptions.json | +| [getMaintenanceConfiguration.js][getmaintenanceconfiguration] | Gets the specified maintenance configuration of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsGet.json | +| [getManagedCluster.js][getmanagedcluster] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGet.json | +| [getManagedClustersByResourceGroup.js][getmanagedclustersbyresourcegroup] | Lists managed clusters in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersListByResourceGroup.json | +| [getPrivateEndpointConnection.js][getprivateendpointconnection] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsGet.json | +| [getSnapshot.js][getsnapshot] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsGet.json | +| [getUpgradeProfileForAgentPool.js][getupgradeprofileforagentpool] | Gets the upgrade profile for an agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetUpgradeProfile.json | +| [getUpgradeProfileForManagedCluster.js][getupgradeprofileformanagedcluster] | Gets the upgrade profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGetUpgradeProfile.json | +| [listAgentPoolsByManagedCluster.js][listagentpoolsbymanagedcluster] | Gets a list of agent pools in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsList.json | +| [listAvailableOperationsForTheContainerServiceResourceProvider.js][listavailableoperationsforthecontainerserviceresourceprovider] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/Operation_List.json | +| [listMaintenanceConfigurationsByManagedCluster.js][listmaintenanceconfigurationsbymanagedcluster] | Gets a list of maintenance configurations in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsList.json | +| [listManagedClusters.js][listmanagedclusters] | Gets a list of managed clusters in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersList.json | +| [listOutboundNetworkDependenciesEndpointsByManagedCluster.js][listoutboundnetworkdependenciesendpointsbymanagedcluster] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/OutboundNetworkDependenciesEndpointsList.json | +| [listPrivateEndpointConnectionsByManagedCluster.js][listprivateendpointconnectionsbymanagedcluster] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsList.json | +| [listPrivateLinkResourcesByManagedCluster.js][listprivatelinkresourcesbymanagedcluster] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateLinkResourcesList.json | +| [listSnapshots.js][listsnapshots] | Gets a list of snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsList.json | +| [listSnapshotsByResourceGroup.js][listsnapshotsbyresourcegroup] | Lists snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsListByResourceGroup.json | +| [maintenanceConfigurationsCreateOrUpdateSample.js][maintenanceconfigurationscreateorupdatesample] | Creates or updates a maintenance configuration in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json | +| [maintenanceConfigurationsDeleteSample.js][maintenanceconfigurationsdeletesample] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json | +| [maintenanceConfigurationsGetSample.js][maintenanceconfigurationsgetsample] | Gets the specified maintenance configuration of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json | +| [maintenanceConfigurationsListByManagedClusterSample.js][maintenanceconfigurationslistbymanagedclustersample] | Gets a list of maintenance configurations in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json | +| [managedClusterSnapshotsCreateOrUpdateSample.js][managedclustersnapshotscreateorupdatesample] | Creates or updates a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json | +| [managedClusterSnapshotsDeleteSample.js][managedclustersnapshotsdeletesample] | Deletes a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json | +| [managedClusterSnapshotsGetSample.js][managedclustersnapshotsgetsample] | Gets a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json | +| [managedClusterSnapshotsListByResourceGroupSample.js][managedclustersnapshotslistbyresourcegroupsample] | Lists managed cluster snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json | +| [managedClusterSnapshotsListSample.js][managedclustersnapshotslistsample] | Gets a list of managed cluster snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json | +| [managedClusterSnapshotsUpdateTagsSample.js][managedclustersnapshotsupdatetagssample] | Updates tags on a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json | +| [managedClustersCreateOrUpdateSample.js][managedclusterscreateorupdatesample] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json | +| [managedClustersDeleteSample.js][managedclustersdeletesample] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json | +| [managedClustersGetAccessProfileSample.js][managedclustersgetaccessprofilesample] | **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json | +| [managedClustersGetCommandResultSample.js][managedclustersgetcommandresultsample] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json | +| [managedClustersGetOSOptionsSample.js][managedclustersgetosoptionssample] | Gets supported OS options in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json | +| [managedClustersGetSample.js][managedclustersgetsample] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json | +| [managedClustersGetUpgradeProfileSample.js][managedclustersgetupgradeprofilesample] | Gets the upgrade profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json | +| [managedClustersListByResourceGroupSample.js][managedclusterslistbyresourcegroupsample] | Lists managed clusters in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json | +| [managedClustersListClusterAdminCredentialsSample.js][managedclusterslistclusteradmincredentialssample] | Lists the admin credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListClusterMonitoringUserCredentialsSample.js][managedclusterslistclustermonitoringusercredentialssample] | Lists the cluster monitoring user credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListClusterUserCredentialsSample.js][managedclusterslistclusterusercredentialssample] | Lists the user credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListOutboundNetworkDependenciesEndpointsSample.js][managedclusterslistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json | +| [managedClustersListSample.js][managedclusterslistsample] | Gets a list of managed clusters in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json | +| [managedClustersResetAadProfileSample.js][managedclustersresetaadprofilesample] | Reset the AAD Profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json | +| [managedClustersResetServicePrincipalProfileSample.js][managedclustersresetserviceprincipalprofilesample] | This action cannot be performed on a cluster that is not using a service principal x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json | +| [managedClustersRotateClusterCertificatesSample.js][managedclustersrotateclustercertificatessample] | See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json | +| [managedClustersRotateServiceAccountSigningKeysSample.js][managedclustersrotateserviceaccountsigningkeyssample] | Rotates the service account signing keys of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json | +| [managedClustersRunCommandSample.js][managedclustersruncommandsample] | AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json | +| [managedClustersStartSample.js][managedclustersstartsample] | See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json | +| [managedClustersStopSample.js][managedclustersstopsample] | This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json | +| [managedClustersUpdateTagsSample.js][managedclustersupdatetagssample] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json | +| [operationsListSample.js][operationslistsample] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionsUpdateSample.js][privateendpointconnectionsupdatesample] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json | +| [privateLinkResourcesListSample.js][privatelinkresourceslistsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json | +| [resetAadProfile.js][resetaadprofile] | Reset the AAD Profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetAADProfile.json | +| [resetServicePrincipalProfile.js][resetserviceprincipalprofile] | This action cannot be performed on a cluster that is not using a service principal x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetServicePrincipalProfile.json | +| [resolvePrivateLinkServiceIdPostSample.js][resolveprivatelinkserviceidpostsample] | Gets the private link service ID for the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json | +| [resolveThePrivateLinkServiceIdForManagedCluster.js][resolvetheprivatelinkserviceidformanagedcluster] | Gets the private link service ID for the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ResolvePrivateLinkServiceId.json | +| [rotateClusterCertificates.js][rotateclustercertificates] | See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersRotateClusterCertificates.json | +| [snapshotsCreateOrUpdateSample.js][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json | +| [snapshotsGetSample.js][snapshotsgetsample] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json | +| [snapshotsListByResourceGroupSample.js][snapshotslistbyresourcegroupsample] | Lists snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json | +| [snapshotsListSample.js][snapshotslistsample] | Gets a list of snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json | +| [snapshotsUpdateTagsSample.js][snapshotsupdatetagssample] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json | +| [startAgentPool.js][startagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Start.json | +| [startManagedCluster.js][startmanagedcluster] | See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStart.json | +| [stopAgentPool.js][stopagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Stop.json | +| [stopManagedCluster.js][stopmanagedcluster] | This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStop.json | +| [submitNewCommand.js][submitnewcommand] | AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandRequest.json | +| [updateAgentPool.js][updateagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Update.json | +| [updateManagedClusterTags.js][updatemanagedclustertags] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersUpdateTags.json | +| [updatePrivateEndpointConnection.js][updateprivateendpointconnection] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsUpdate.json | +| [updateSnapshotTags.js][updatesnapshottags] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsUpdateTags.json | +| [upgradeAgentPoolNodeImageVersion.js][upgradeagentpoolnodeimageversion] | Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsUpgradeNodeImageVersion.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node agentPoolsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node agentPoolsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[agentpoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsCreateOrUpdateSample.js +[agentpoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsDeleteSample.js +[agentpoolsgetavailableagentpoolversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js +[agentpoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetSample.js +[agentpoolsgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetUpgradeProfileSample.js +[agentpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsListSample.js +[agentpoolsupgradenodeimageversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsUpgradeNodeImageVersionSample.js +[commandfailedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandFailedResult.js +[commandsucceedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandSucceedResult.js +[createagentpoolusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js +[createagentpoolwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEncryptionAtHostEnabled.js +[createagentpoolwithephemeralosdisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEphemeralOSDisk.js +[createagentpoolwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithFipsEnabledOS.js +[createagentpoolwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithGpumig.js +[createagentpoolwithkrustletandthewasiruntime]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js +[createagentpoolwithkubeletconfigandlinuxosconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js +[createagentpoolwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithOssku.js +[createagentpoolwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithPpg.js +[createagentpoolwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithUltraSsdEnabled.js +[createmanagedclusterusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js +[createmanagedclusterwithaksmanagednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js +[createmanagedclusterwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithEncryptionAtHostEnabled.js +[createmanagedclusterwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithFipsEnabledOS.js +[createmanagedclusterwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithGpumig.js +[createmanagedclusterwithhttpproxyconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithHttpProxyConfigured.js +[createmanagedclusterwithnodepublicipprefix]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithNodePublicIPPrefix.js +[createmanagedclusterwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithOssku.js +[createmanagedclusterwithpodidentityenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPodIdentityEnabled.js +[createmanagedclusterwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPpg.js +[createmanagedclusterwithruncommanddisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithRunCommandDisabled.js +[createmanagedclusterwithsecurityprofileconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithSecurityProfileConfigured.js +[createmanagedclusterwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUltraSsdEnabled.js +[createmanagedclusterwithuserassignednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js +[createmanagedprivateclusterwithfqdnsubdomainspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js +[createmanagedprivateclusterwithpublicfqdnspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js +[createorupdateaadmanagedclusterwithenableazurerbac]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js +[createorupdateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAgentPool.js +[createorupdatemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateMaintenanceConfiguration.js +[createorupdatemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedCluster.js +[createorupdatemanagedclusterwithdualstacknetworking]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js +[createorupdatemanagedclusterwithenableahub]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithEnableAhub.js +[createorupdatemanagedclusterwithwindowsgmsaenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js +[createorupdatesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateSnapshot.js +[createspotagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createSpotAgentPool.js +[deleteagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteAgentPool.js +[deletemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteMaintenanceConfiguration.js +[deletemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteManagedCluster.js +[deleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deletePrivateEndpointConnection.js +[deletesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteSnapshot.js +[getagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAgentPool.js +[getavailableversionsforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAvailableVersionsForAgentPool.js +[getcontainerserviceosoptions]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getContainerServiceOSOptions.js +[getmaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getMaintenanceConfiguration.js +[getmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedCluster.js +[getmanagedclustersbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedClustersByResourceGroup.js +[getprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getPrivateEndpointConnection.js +[getsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getSnapshot.js +[getupgradeprofileforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForAgentPool.js +[getupgradeprofileformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForManagedCluster.js +[listagentpoolsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAgentPoolsByManagedCluster.js +[listavailableoperationsforthecontainerserviceresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js +[listmaintenanceconfigurationsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listMaintenanceConfigurationsByManagedCluster.js +[listmanagedclusters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listManagedClusters.js +[listoutboundnetworkdependenciesendpointsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js +[listprivateendpointconnectionsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateEndpointConnectionsByManagedCluster.js +[listprivatelinkresourcesbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateLinkResourcesByManagedCluster.js +[listsnapshots]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshots.js +[listsnapshotsbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshotsByResourceGroup.js +[maintenanceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsCreateOrUpdateSample.js +[maintenanceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsDeleteSample.js +[maintenanceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsGetSample.js +[maintenanceconfigurationslistbymanagedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsListByManagedClusterSample.js +[managedclustersnapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsCreateOrUpdateSample.js +[managedclustersnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsDeleteSample.js +[managedclustersnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsGetSample.js +[managedclustersnapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListByResourceGroupSample.js +[managedclustersnapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListSample.js +[managedclustersnapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsUpdateTagsSample.js +[managedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersCreateOrUpdateSample.js +[managedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersDeleteSample.js +[managedclustersgetaccessprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetAccessProfileSample.js +[managedclustersgetcommandresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetCommandResultSample.js +[managedclustersgetosoptionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetOSOptionsSample.js +[managedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetSample.js +[managedclustersgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetUpgradeProfileSample.js +[managedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListByResourceGroupSample.js +[managedclusterslistclusteradmincredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterAdminCredentialsSample.js +[managedclusterslistclustermonitoringusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js +[managedclusterslistclusterusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterUserCredentialsSample.js +[managedclusterslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js +[managedclusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListSample.js +[managedclustersresetaadprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetAadProfileSample.js +[managedclustersresetserviceprincipalprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetServicePrincipalProfileSample.js +[managedclustersrotateclustercertificatessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateClusterCertificatesSample.js +[managedclustersrotateserviceaccountsigningkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateServiceAccountSigningKeysSample.js +[managedclustersruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRunCommandSample.js +[managedclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStartSample.js +[managedclustersstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStopSample.js +[managedclustersupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersUpdateTagsSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/operationsListSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsListSample.js +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsUpdateSample.js +[privatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateLinkResourcesListSample.js +[resetaadprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetAadProfile.js +[resetserviceprincipalprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetServicePrincipalProfile.js +[resolveprivatelinkserviceidpostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolvePrivateLinkServiceIdPostSample.js +[resolvetheprivatelinkserviceidformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js +[rotateclustercertificates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/rotateClusterCertificates.js +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsCreateOrUpdateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsGetSample.js +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListByResourceGroupSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListSample.js +[snapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsUpdateTagsSample.js +[startagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startAgentPool.js +[startmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startManagedCluster.js +[stopagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopAgentPool.js +[stopmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopManagedCluster.js +[submitnewcommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/submitNewCommand.js +[updateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateAgentPool.js +[updatemanagedclustertags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateManagedClusterTags.js +[updateprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updatePrivateEndpointConnection.js +[updatesnapshottags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateSnapshotTags.js +[upgradeagentpoolnodeimageversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/upgradeAgentPoolNodeImageVersion.js +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice/README.md diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsCreateOrUpdateSample.js new file mode 100644 index 000000000000..18750c8781d3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsCreateOrUpdateSample.js @@ -0,0 +1,646 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json + */ +async function associateAgentPoolWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1", + count: 3, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +associateAgentPoolWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Snapshot.json + */ +async function createAgentPoolUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1", + }, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolUsingAnAgentPoolSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json + */ +async function createAgentPoolWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ +async function createAgentPoolWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableEncryptionAtHost: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEncryptionAtHostEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Ephemeral.json + */ +async function createAgentPoolWithEphemeralOSDisk() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + orchestratorVersion: "", + osDiskSizeGB: 64, + osDiskType: "Ephemeral", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEphemeralOSDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableFIPS.json + */ +async function createAgentPoolWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithFipsEnabledOS().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_GPUMIG.json + */ +async function createAgentPoolWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + gpuInstanceProfile: "MIG2g", + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_ND96asr_v4", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithGpumig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_WasmWasi.json + */ +async function createAgentPoolWithKrustletAndTheWasiRuntime() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2", + workloadRuntime: "WasmWasi", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKrustletAndTheWasiRuntime().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json + */ +async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKubeletConfigAndLinuxOSConfig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json + */ +async function createAgentPoolWithMessageOfTheDay() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + messageOfTheDay: "Zm9vCg==", + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithMessageOfTheDay().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_OSSKU.json + */ +async function createAgentPoolWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithOssku().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_PPG.json + */ +async function createAgentPoolWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + orchestratorVersion: "", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithPpg().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json + */ +async function createAgentPoolWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableUltraSSD: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithUltraSsdEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Spot.json + */ +async function createSpotAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createSpotAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Update.json + */ +async function createOrUpdateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + mode: "User", + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createOrUpdateAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Start.json + */ +async function startAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { powerState: { code: "Running" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +startAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Stop.json + */ +async function stopAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { powerState: { code: "Stopped" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +stopAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Update.json + */ +async function updateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableAutoScaling: true, + maxCount: 2, + minCount: 2, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsDeleteSample.js new file mode 100644 index 000000000000..dc990e9abceb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsDeleteSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json + */ +async function deleteAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json + */ +async function deleteAgentPoolByIgnoringPodDisruptionBudget() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPoolByIgnoringPodDisruptionBudget().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js new file mode 100644 index 000000000000..bb238e62b144 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * + * @summary See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ +async function getAvailableVersionsForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getAvailableAgentPoolVersions( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getAvailableVersionsForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetSample.js new file mode 100644 index 000000000000..60eb6ed7107c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified managed cluster agent pool. + * + * @summary Gets the specified managed cluster agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json + */ +async function getAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.get(resourceGroupName, resourceName, agentPoolName); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetUpgradeProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetUpgradeProfileSample.js new file mode 100644 index 000000000000..5a5158ae6d97 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsGetUpgradeProfileSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the upgrade profile for an agent pool. + * + * @summary Gets the upgrade profile for an agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json + */ +async function getUpgradeProfileForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getUpgradeProfile( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getUpgradeProfileForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsListSample.js new file mode 100644 index 000000000000..ef4d9ee056e9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsListSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of agent pools in the specified managed cluster. + * + * @summary Gets a list of agent pools in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json + */ +async function listAgentPoolsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.agentPools.list(resourceGroupName, resourceName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAgentPoolsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsUpgradeNodeImageVersionSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsUpgradeNodeImageVersionSample.js new file mode 100644 index 000000000000..82c7e7ba823d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/agentPoolsUpgradeNodeImageVersionSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * + * @summary Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json + */ +async function upgradeAgentPoolNodeImageVersion() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginUpgradeNodeImageVersionAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +upgradeAgentPoolNodeImageVersion().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandFailedResult.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandFailedResult.js new file mode 100644 index 000000000000..73629ae3b1ef --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandFailedResult.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultFailed.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function commandFailedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandFailedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandSucceedResult.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandSucceedResult.js new file mode 100644 index 000000000000..5f0e49e89be4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/commandSucceedResult.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultSucceed.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function commandSucceedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandSucceedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js new file mode 100644 index 000000000000..87d3faad1f5a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Snapshot.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1", + }, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolUsingAnAgentPoolSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEncryptionAtHostEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEncryptionAtHostEnabled.js new file mode 100644 index 000000000000..62c86b7b4f0f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEncryptionAtHostEnabled.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableEncryptionAtHost: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEncryptionAtHostEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEphemeralOSDisk.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEphemeralOSDisk.js new file mode 100644 index 000000000000..d10a4df0ccf3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithEphemeralOSDisk.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Ephemeral.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithEphemeralOSDisk() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + orchestratorVersion: "", + osDiskSizeGB: 64, + osDiskType: "Ephemeral", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEphemeralOSDisk().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithFipsEnabledOS.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithFipsEnabledOS.js new file mode 100644 index 000000000000..c3762ee0cee1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithFipsEnabledOS.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableFIPS.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithFipsEnabledOS().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithGpumig.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithGpumig.js new file mode 100644 index 000000000000..69465952ec47 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithGpumig.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_GPUMIG.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + gpuInstanceProfile: "MIG2g", + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_ND96asr_v4", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithGpumig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js new file mode 100644 index 000000000000..76b0c11652e3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_WasmWasi.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithKrustletAndTheWasiRuntime() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2", + workloadRuntime: "WasmWasi", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKrustletAndTheWasiRuntime().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js new file mode 100644 index 000000000000..db2846213f02 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_CustomNodeConfig.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKubeletConfigAndLinuxOSConfig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithOssku.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithOssku.js new file mode 100644 index 000000000000..2f863fb82123 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithOssku.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_OSSKU.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort", + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true, + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always", + }, + orchestratorVersion: "", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithOssku().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithPpg.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithPpg.js new file mode 100644 index 000000000000..158ce4268b59 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithPpg.js @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_PPG.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + orchestratorVersion: "", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithPpg().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithUltraSsdEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithUltraSsdEnabled.js new file mode 100644 index 000000000000..8229692ab5c2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createAgentPoolWithUltraSsdEnabled.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableUltraSSD.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createAgentPoolWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableUltraSSD: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithUltraSsdEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js new file mode 100644 index 000000000000..2f214767ad31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Snapshot.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1", + }, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAnAgentPoolSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js new file mode 100644 index 000000000000..8fee1589afc1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_ManagedNATGateway.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + natGatewayProfile: { managedOutboundIPProfile: { count: 2 } }, + outboundType: "managedNATGateway", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithAksManagedNatGatewayAsOutboundType().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithEncryptionAtHostEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithEncryptionAtHostEnabled.js new file mode 100644 index 000000000000..84cf0d6fe071 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithEncryptionAtHostEnabled.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithEncryptionAtHostEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithFipsEnabledOS.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithFipsEnabledOS.js new file mode 100644 index 000000000000..33d248add827 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithFipsEnabledOS.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnabledFIPS.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithFipsEnabledOS().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithGpumig.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithGpumig.js new file mode 100644 index 000000000000..c30f611d5ee6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithGpumig.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_GPUMIG.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + gpuInstanceProfile: "MIG3g", + mode: "System", + osType: "Linux", + vmSize: "Standard_ND96asr_v4", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithGpumig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithHttpProxyConfigured.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithHttpProxyConfigured.js new file mode 100644 index 000000000000..dee98cf6bad3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithHttpProxyConfigured.js @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_HTTPProxy.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithHttpProxyConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithHttpProxyConfigured().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithNodePublicIPPrefix.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithNodePublicIPPrefix.js new file mode 100644 index 000000000000..e60d26b4ce57 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithNodePublicIPPrefix.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithNodePublicIPPrefix() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + nodePublicIPPrefixID: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithNodePublicIPPrefix().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithOssku.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithOssku.js new file mode 100644 index 000000000000..e2436d1825a6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithOssku.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_OSSKU.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithOssku().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPodIdentityEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPodIdentityEnabled.js new file mode 100644 index 000000000000..cd9317cc8def --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPodIdentityEnabled.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PodIdentity.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithPodIdentityEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + podIdentityProfile: { allowNetworkPluginKubenet: true, enabled: true }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPodIdentityEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPpg.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPpg.js new file mode 100644 index 000000000000..2b93d9e4eff7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithPpg.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PPG.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPpg().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithRunCommandDisabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithRunCommandDisabled.js new file mode 100644 index 000000000000..9d8bb6b9029a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithRunCommandDisabled.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DisableRunCommand.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithRunCommandDisabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { disableRunCommand: true }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithRunCommandDisabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithSecurityProfileConfigured.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithSecurityProfileConfigured.js new file mode 100644 index 000000000000..915745a55dcf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithSecurityProfileConfigured.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_SecurityProfile.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithSecurityProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + securityProfile: { + azureDefender: { + enabled: true, + logAnalyticsWorkspaceResourceId: + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME", + }, + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithSecurityProfileConfigured().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUltraSsdEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUltraSsdEnabled.js new file mode 100644 index 000000000000..db8c43cb0193 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUltraSsdEnabled.js @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableUltraSSD.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + enableUltraSSD: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUltraSsdEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js new file mode 100644 index 000000000000..6a5a4eb6c895 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + outboundType: "userAssignedNATGateway", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUserAssignedNatGatewayAsOutboundType().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js new file mode 100644 index 000000000000..04a6c745e775 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + privateDNSZone: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io", + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + enablePodSecurityPolicy: true, + enableRbac: true, + fqdnSubdomain: "domain1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithFqdnSubdomainSpecified().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js new file mode 100644 index 000000000000..b86f085e81c7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createManagedPrivateClusterWithPublicFqdnSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + enablePrivateClusterPublicFqdn: true, + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithPublicFqdnSpecified().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js new file mode 100644 index 000000000000..261231b58887 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + aadProfile: { enableAzureRbac: true, managed: true }, + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateAadManagedClusterWithEnableAzureRbac().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAgentPool.js new file mode 100644 index 000000000000..363b1f032713 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateAgentPool.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Update.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + mode: "User", + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createOrUpdateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateMaintenanceConfiguration.js new file mode 100644 index 000000000000..40869e8fd926 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateMaintenanceConfiguration.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a maintenance configuration in the specified managed cluster. + * + * @summary Creates or updates a maintenance configuration in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsCreate_Update.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const parameters = { + notAllowedTime: [ + { + end: new Date("2020-11-30T12:00:00Z"), + start: new Date("2020-11-26T03:00:00Z"), + }, + ], + timeInWeek: [{ day: "Monday", hourSlots: [1, 2] }], + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.createOrUpdate( + resourceGroupName, + resourceName, + configName, + parameters + ); + console.log(result); +} + +createOrUpdateMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedCluster.js new file mode 100644 index 000000000000..a6f726ff95e4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedCluster.js @@ -0,0 +1,89 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Update.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false", + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js new file mode 100644 index 000000000000..305dbe59c98b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js @@ -0,0 +1,90 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DualStackNetworking.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateManagedClusterWithDualStackNetworking() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false", + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + ipFamilies: ["IPv4", "IPv6"], + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithDualStackNetworking().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithEnableAhub.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithEnableAhub.js new file mode 100644 index 000000000000..319cfb8ad065 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithEnableAhub.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateManagedClusterWithEnableAhub() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + licenseType: "Windows_Server", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableAhub().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js new file mode 100644 index 000000000000..aa8e7209b1ec --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + gmsaProfile: { enabled: true }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithWindowsGMsaEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateSnapshot.js new file mode 100644 index 000000000000..950cf4929188 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createOrUpdateSnapshot.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsCreate.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createOrUpdateSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0", + }, + location: "westus", + tags: { key1: "val1", key2: "val2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate(resourceGroupName, resourceName, parameters); + console.log(result); +} + +createOrUpdateSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createSpotAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createSpotAgentPool.js new file mode 100644 index 000000000000..484cf75f6fa6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/createSpotAgentPool.js @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Spot.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function createSpotAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createSpotAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteAgentPool.js new file mode 100644 index 000000000000..1be7ff9fb4ac --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteAgentPool.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsDelete.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteMaintenanceConfiguration.js new file mode 100644 index 000000000000..7808ad14dc6e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteMaintenanceConfiguration.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a maintenance configuration. + * + * @summary Deletes a maintenance configuration. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsDelete.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.delete( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +deleteMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteManagedCluster.js new file mode 100644 index 000000000000..4bc6c2cefc5c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a managed cluster. + * + * @summary Deletes a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersDelete.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginDeleteAndWait(resourceGroupName, resourceName); + console.log(result); +} + +deleteManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deletePrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deletePrivateEndpointConnection.js new file mode 100644 index 000000000000..195570ba5a3b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deletePrivateEndpointConnection.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a private endpoint connection. + * + * @summary Deletes a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsDelete.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deletePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +deletePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteSnapshot.js new file mode 100644 index 000000000000..1c9cf3f681b3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/deleteSnapshot.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsDelete.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function deleteSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAgentPool.js new file mode 100644 index 000000000000..e7e37bfe2426 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAgentPool.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the specified managed cluster agent pool. + * + * @summary Gets the specified managed cluster agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGet.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.get(resourceGroupName, resourceName, agentPoolName); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAvailableVersionsForAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAvailableVersionsForAgentPool.js new file mode 100644 index 000000000000..9820804ab6f2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getAvailableVersionsForAgentPool.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * + * @summary See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getAvailableVersionsForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getAvailableAgentPoolVersions( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getAvailableVersionsForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getContainerServiceOSOptions.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getContainerServiceOSOptions.js new file mode 100644 index 000000000000..0ad1bda643c0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getContainerServiceOSOptions.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets supported OS options in the specified subscription. + * + * @summary Gets supported OS options in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ContainerServiceGetOSOptions.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getContainerServiceOSOptions() { + const subscriptionId = "subid1"; + const location = "location1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getOSOptions(location); + console.log(result); +} + +getContainerServiceOSOptions().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getMaintenanceConfiguration.js new file mode 100644 index 000000000000..e5259f26615d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getMaintenanceConfiguration.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the specified maintenance configuration of a managed cluster. + * + * @summary Gets the specified maintenance configuration of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsGet.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.get( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +getMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedCluster.js new file mode 100644 index 000000000000..bb58d0367806 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a managed cluster. + * + * @summary Gets a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGet.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.get(resourceGroupName, resourceName); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedClustersByResourceGroup.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedClustersByResourceGroup.js new file mode 100644 index 000000000000..0f093f125b26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getManagedClustersByResourceGroup.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists managed clusters in the specified subscription and resource group. + * + * @summary Lists managed clusters in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersListByResourceGroup.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getManagedClustersByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getManagedClustersByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getPrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getPrivateEndpointConnection.js new file mode 100644 index 000000000000..cfa27e25428a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getPrivateEndpointConnection.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsGet.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getPrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +getPrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getSnapshot.js new file mode 100644 index 000000000000..7efb39639237 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getSnapshot.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a snapshot. + * + * @summary Gets a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsGet.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, resourceName); + console.log(result); +} + +getSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForAgentPool.js new file mode 100644 index 000000000000..04201a47715a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForAgentPool.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the upgrade profile for an agent pool. + * + * @summary Gets the upgrade profile for an agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetUpgradeProfile.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getUpgradeProfileForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getUpgradeProfile( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getUpgradeProfileForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForManagedCluster.js new file mode 100644 index 000000000000..66d391247cae --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/getUpgradeProfileForManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the upgrade profile of a managed cluster. + * + * @summary Gets the upgrade profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGetUpgradeProfile.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function getUpgradeProfileForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getUpgradeProfile(resourceGroupName, resourceName); + console.log(result); +} + +getUpgradeProfileForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAgentPoolsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAgentPoolsByManagedCluster.js new file mode 100644 index 000000000000..d46bdd85cb0c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAgentPoolsByManagedCluster.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of agent pools in the specified managed cluster. + * + * @summary Gets a list of agent pools in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listAgentPoolsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.agentPools.list(resourceGroupName, resourceName)) { + resArray.push(item); + } + console.log(resArray); +} + +listAgentPoolsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js new file mode 100644 index 000000000000..832f25008893 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of operations. + * + * @summary Gets a list of operations. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/Operation_List.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listAvailableOperationsForTheContainerServiceResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailableOperationsForTheContainerServiceResourceProvider().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listMaintenanceConfigurationsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listMaintenanceConfigurationsByManagedCluster.js new file mode 100644 index 000000000000..813faef67060 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listMaintenanceConfigurationsByManagedCluster.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of maintenance configurations in the specified managed cluster. + * + * @summary Gets a list of maintenance configurations in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listMaintenanceConfigurationsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.maintenanceConfigurations.listByManagedCluster( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listMaintenanceConfigurationsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listManagedClusters.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listManagedClusters.js new file mode 100644 index 000000000000..8c81bd209a2c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listManagedClusters.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of managed clusters in the specified subscription. + * + * @summary Gets a list of managed clusters in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listManagedClusters() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusters().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js new file mode 100644 index 000000000000..67ec0e54a2cf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * + * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/OutboundNetworkDependenciesEndpointsList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listOutboundNetworkDependenciesEndpoints( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listOutboundNetworkDependenciesEndpointsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateEndpointConnectionsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateEndpointConnectionsByManagedCluster.js new file mode 100644 index 000000000000..413c36392717 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateEndpointConnectionsByManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listPrivateEndpointConnectionsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.list(resourceGroupName, resourceName); + console.log(result); +} + +listPrivateEndpointConnectionsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateLinkResourcesByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateLinkResourcesByManagedCluster.js new file mode 100644 index 000000000000..94aeffb357e4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listPrivateLinkResourcesByManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateLinkResourcesList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listPrivateLinkResourcesByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateLinkResources.list(resourceGroupName, resourceName); + console.log(result); +} + +listPrivateLinkResourcesByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshots.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshots.js new file mode 100644 index 000000000000..44ece47204c1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshots.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of snapshots in the specified subscription. + * + * @summary Gets a list of snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsList.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshotsByResourceGroup.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshotsByResourceGroup.js new file mode 100644 index 000000000000..8fe36c3de87e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/listSnapshotsByResourceGroup.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists snapshots in the specified subscription and resource group. + * + * @summary Lists snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsListByResourceGroup.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function listSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..5121f0094e05 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsCreateOrUpdateSample.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a maintenance configuration in the specified managed cluster. + * + * @summary Creates or updates a maintenance configuration in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json + */ +async function createOrUpdateMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const parameters = { + notAllowedTime: [ + { + end: new Date("2020-11-30T12:00:00Z"), + start: new Date("2020-11-26T03:00:00Z"), + }, + ], + timeInWeek: [{ day: "Monday", hourSlots: [1, 2] }], + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.createOrUpdate( + resourceGroupName, + resourceName, + configName, + parameters + ); + console.log(result); +} + +createOrUpdateMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsDeleteSample.js new file mode 100644 index 000000000000..2d343b74b4da --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a maintenance configuration. + * + * @summary Deletes a maintenance configuration. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json + */ +async function deleteMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.delete( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +deleteMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsGetSample.js new file mode 100644 index 000000000000..52477914b72c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the specified maintenance configuration of a managed cluster. + * + * @summary Gets the specified maintenance configuration of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json + */ +async function getMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.get( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +getMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsListByManagedClusterSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsListByManagedClusterSample.js new file mode 100644 index 000000000000..855c2722102b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/maintenanceConfigurationsListByManagedClusterSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of maintenance configurations in the specified managed cluster. + * + * @summary Gets a list of maintenance configurations in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json + */ +async function listMaintenanceConfigurationsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.maintenanceConfigurations.listByManagedCluster( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listMaintenanceConfigurationsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsCreateOrUpdateSample.js new file mode 100644 index 000000000000..5dc894032dfd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsCreateOrUpdateSample.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a managed cluster snapshot. + * + * @summary Creates or updates a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json + */ +async function createOrUpdateManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1", + }, + location: "westus", + tags: { key1: "val1", key2: "val2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.createOrUpdate( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsDeleteSample.js new file mode 100644 index 000000000000..c25127d9acc4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a managed cluster snapshot. + * + * @summary Deletes a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json + */ +async function deleteManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsGetSample.js new file mode 100644 index 000000000000..dbd8105479c7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a managed cluster snapshot. + * + * @summary Gets a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json + */ +async function getManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.get(resourceGroupName, resourceName); + console.log(result); +} + +getManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListByResourceGroupSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListByResourceGroupSample.js new file mode 100644 index 000000000000..bc53d4c102ea --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists managed cluster snapshots in the specified subscription and resource group. + * + * @summary Lists managed cluster snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json + */ +async function listManagedClusterSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListSample.js new file mode 100644 index 000000000000..273f4ae620c4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of managed cluster snapshots in the specified subscription. + * + * @summary Gets a list of managed cluster snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json + */ +async function listManagedClusterSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsUpdateTagsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsUpdateTagsSample.js new file mode 100644 index 000000000000..4eae45ee3e2c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClusterSnapshotsUpdateTagsSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates tags on a managed cluster snapshot. + * + * @summary Updates tags on a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json + */ +async function updateManagedClusterSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.updateTags( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersCreateOrUpdateSample.js new file mode 100644 index 000000000000..5712c884f4c9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersCreateOrUpdateSample.js @@ -0,0 +1,1653 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json + */ +async function associateManagedClusterWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +associateManagedClusterWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_MCSnapshot.json + */ +async function createManagedClusterUsingAManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1", + }, + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAManagedClusterSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Snapshot.json + */ +async function createManagedClusterUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1", + }, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAnAgentPoolSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json + */ +async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + natGatewayProfile: { managedOutboundIPProfile: { count: 2 } }, + outboundType: "managedNATGateway", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithAksManagedNatGatewayAsOutboundType().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json + */ +async function createManagedClusterWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ +async function createManagedClusterWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithEncryptionAtHostEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json + */ +async function createManagedClusterWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithFipsEnabledOS().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_GPUMIG.json + */ +async function createManagedClusterWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + gpuInstanceProfile: "MIG3g", + mode: "System", + osType: "Linux", + vmSize: "Standard_ND96asr_v4", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithGpumig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_HTTPProxy.json + */ +async function createManagedClusterWithHttpProxyConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithHttpProxyConfigured().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ +async function createManagedClusterWithNodePublicIPPrefix() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + nodePublicIPPrefixID: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithNodePublicIPPrefix().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_OSSKU.json + */ +async function createManagedClusterWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=", + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithOssku().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PPG.json + */ +async function createManagedClusterWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPpg().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PodIdentity.json + */ +async function createManagedClusterWithPodIdentityEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + podIdentityProfile: { allowNetworkPluginKubenet: true, enabled: true }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPodIdentityEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json + */ +async function createManagedClusterWithRunCommandDisabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { disableRunCommand: true }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithRunCommandDisabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_SecurityProfile.json + */ +async function createManagedClusterWithSecurityProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + securityProfile: { + azureDefender: { + enabled: true, + logAnalyticsWorkspaceResourceId: + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME", + }, + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithSecurityProfileConfigured().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json + */ +async function createManagedClusterWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + enableUltraSSD: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUltraSsdEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ +async function createManagedClusterWithWebAppRoutingIngressProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + dnsPrefix: "dnsprefix1", + ingressProfile: { + webAppRouting: { + dnsZoneResourceId: + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME", + enabled: true, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithWebAppRoutingIngressProfileConfigured().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ +async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + outboundType: "userAssignedNATGateway", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUserAssignedNatGatewayAsOutboundType().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ +async function createManagedPrivateClusterWithPublicFqdnSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + enablePrivateClusterPublicFqdn: true, + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithPublicFqdnSpecified().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ +async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2", + }, + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + privateDNSZone: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io", + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + enablePodSecurityPolicy: true, + enableRbac: true, + fqdnSubdomain: "domain1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithFqdnSubdomainSpecified().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ +async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + aadProfile: { enableAzureRbac: true, managed: true }, + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateAadManagedClusterWithEnableAzureRbac().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Update.json + */ +async function createOrUpdateManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false", + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedCluster().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ +async function createOrUpdateManagedClusterWithEnableAhub() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + licenseType: "Windows_Server", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableAhub().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json + */ +async function createOrUpdateManagedClusterWithEnableNamespaceResources() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enableNamespaceResources: true, + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableNamespaceResources().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ +async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + gmsaProfile: { enabled: true }, + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithWindowsGMsaEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json + */ +async function createOrUpdateManagedClusterWithDualStackNetworking() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2", + }, + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false", + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": + {}, + }, + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] }, + }, + location: "location1", + networkProfile: { + ipFamilies: ["IPv4", "IPv6"], + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer", + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithDualStackNetworking().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersDeleteSample.js new file mode 100644 index 000000000000..945aca507821 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a managed cluster. + * + * @summary Deletes a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json + */ +async function deleteManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginDeleteAndWait(resourceGroupName, resourceName); + console.log(result); +} + +deleteManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetAccessProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetAccessProfileSample.js new file mode 100644 index 000000000000..4131c44fedbb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetAccessProfileSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + * + * @summary **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const roleName = "clusterUser"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getAccessProfile( + resourceGroupName, + resourceName, + roleName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetCommandResultSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetCommandResultSample.js new file mode 100644 index 000000000000..9507182a6abd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetCommandResultSample.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json + */ +async function commandFailedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandFailedResult().catch(console.error); + +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultSucceed.json + */ +async function commandSucceedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandSucceedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetOSOptionsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetOSOptionsSample.js new file mode 100644 index 000000000000..9440939e2f3b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetOSOptionsSample.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets supported OS options in the specified subscription. + * + * @summary Gets supported OS options in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json + */ +async function getContainerServiceOSOptions() { + const subscriptionId = "subid1"; + const location = "location1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getOSOptions(location); + console.log(result); +} + +getContainerServiceOSOptions().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetSample.js new file mode 100644 index 000000000000..684e08c7793b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a managed cluster. + * + * @summary Gets a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.get(resourceGroupName, resourceName); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetUpgradeProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetUpgradeProfileSample.js new file mode 100644 index 000000000000..2374ed57fc56 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersGetUpgradeProfileSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the upgrade profile of a managed cluster. + * + * @summary Gets the upgrade profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json + */ +async function getUpgradeProfileForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getUpgradeProfile(resourceGroupName, resourceName); + console.log(result); +} + +getUpgradeProfileForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListByResourceGroupSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListByResourceGroupSample.js new file mode 100644 index 000000000000..ae8878e5595c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists managed clusters in the specified subscription and resource group. + * + * @summary Lists managed clusters in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json + */ +async function getManagedClustersByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +getManagedClustersByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterAdminCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterAdminCredentialsSample.js new file mode 100644 index 000000000000..7a1cd4060d70 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterAdminCredentialsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the admin credentials of a managed cluster. + * + * @summary Lists the admin credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterAdminCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js new file mode 100644 index 000000000000..f8b779252901 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the cluster monitoring user credentials of a managed cluster. + * + * @summary Lists the cluster monitoring user credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterMonitoringUserCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterUserCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterUserCredentialsSample.js new file mode 100644 index 000000000000..2bda56284e1d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListClusterUserCredentialsSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists the user credentials of a managed cluster. + * + * @summary Lists the user credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterUserCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js new file mode 100644 index 000000000000..242e8c0a1f9e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * + * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json + */ +async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listOutboundNetworkDependenciesEndpoints( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listOutboundNetworkDependenciesEndpointsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListSample.js new file mode 100644 index 000000000000..06fca7d8f39c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of managed clusters in the specified subscription. + * + * @summary Gets a list of managed clusters in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json + */ +async function listManagedClusters() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusters().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetAadProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetAadProfileSample.js new file mode 100644 index 000000000000..e13d185033ad --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetAadProfileSample.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Reset the AAD Profile of a managed cluster. + * + * @summary Reset the AAD Profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json + */ +async function resetAadProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + clientAppID: "clientappid", + serverAppID: "serverappid", + serverAppSecret: "serverappsecret", + tenantID: "tenantid", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetAADProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetAadProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetServicePrincipalProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetServicePrincipalProfileSample.js new file mode 100644 index 000000000000..b0afae5e070e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersResetServicePrincipalProfileSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to This action cannot be performed on a cluster that is not using a service principal + * + * @summary This action cannot be performed on a cluster that is not using a service principal + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json + */ +async function resetServicePrincipalProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + clientId: "clientid", + secret: "secret", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetServicePrincipalProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetServicePrincipalProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateClusterCertificatesSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateClusterCertificatesSample.js new file mode 100644 index 000000000000..31d5a457f67d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateClusterCertificatesSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * + * @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json + */ +async function rotateClusterCertificates() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateClusterCertificatesAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterCertificates().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateServiceAccountSigningKeysSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateServiceAccountSigningKeysSample.js new file mode 100644 index 000000000000..50fd777fbfe5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRotateServiceAccountSigningKeysSample.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Rotates the service account signing keys of a managed cluster. + * + * @summary Rotates the service account signing keys of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json + */ +async function rotateClusterServiceAccountSigningKeys() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateServiceAccountSigningKeysAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterServiceAccountSigningKeys().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRunCommandSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRunCommandSample.js new file mode 100644 index 000000000000..677cb9c378e3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersRunCommandSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @summary AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json + */ +async function submitNewCommand() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const requestPayload = { + clusterToken: "", + command: "kubectl apply -f ns.yaml", + context: "", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRunCommandAndWait( + resourceGroupName, + resourceName, + requestPayload + ); + console.log(result); +} + +submitNewCommand().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStartSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStartSample.js new file mode 100644 index 000000000000..1e567ddb3e2e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStartSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * + * @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json + */ +async function startManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStartAndWait(resourceGroupName, resourceName); + console.log(result); +} + +startManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStopSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStopSample.js new file mode 100644 index 000000000000..f67b91e58849 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersStopSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * + * @summary This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json + */ +async function stopManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStopAndWait(resourceGroupName, resourceName); + console.log(result); +} + +stopManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersUpdateTagsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersUpdateTagsSample.js new file mode 100644 index 000000000000..8f2384e37788 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/managedClustersUpdateTagsSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates tags on a managed cluster. + * + * @summary Updates tags on a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json + */ +async function updateManagedClusterTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { tags: { archv3: "", tier: "testing" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginUpdateTagsAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/operationsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/operationsListSample.js new file mode 100644 index 000000000000..d0a6bcd15445 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/operationsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of operations. + * + * @summary Gets a list of operations. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json + */ +async function listAvailableOperationsForTheContainerServiceResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailableOperationsForTheContainerServiceResourceProvider().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/package.json b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/package.json new file mode 100644 index 000000000000..38319091e3c7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-containerservice-js-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/containerservice/arm-containerservice" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice", + "dependencies": { + "@azure/arm-containerservice": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..3de69c4caa5d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a private endpoint connection. + * + * @summary Deletes a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json + */ +async function deletePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +deletePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..dd76c4c56fe8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json + */ +async function getPrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +getPrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..e79a489fbef9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsListSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json + */ +async function listPrivateEndpointConnectionsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.list(resourceGroupName, resourceName); + console.log(result); +} + +listPrivateEndpointConnectionsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsUpdateSample.js new file mode 100644 index 000000000000..7942d7ffe592 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateEndpointConnectionsUpdateSample.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates a private endpoint connection. + * + * @summary Updates a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json + */ +async function updatePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const parameters = { + privateLinkServiceConnectionState: { status: "Approved" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +updatePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateLinkResourcesListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateLinkResourcesListSample.js new file mode 100644 index 000000000000..0e5fd1c932ed --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/privateLinkResourcesListSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json + */ +async function listPrivateLinkResourcesByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateLinkResources.list(resourceGroupName, resourceName); + console.log(result); +} + +listPrivateLinkResourcesByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetAadProfile.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetAadProfile.js new file mode 100644 index 000000000000..4a67f8d62add --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetAadProfile.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Reset the AAD Profile of a managed cluster. + * + * @summary Reset the AAD Profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetAADProfile.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function resetAadProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + clientAppID: "clientappid", + serverAppID: "serverappid", + serverAppSecret: "serverappsecret", + tenantID: "tenantid", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetAADProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetAadProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetServicePrincipalProfile.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetServicePrincipalProfile.js new file mode 100644 index 000000000000..adf16181626c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resetServicePrincipalProfile.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This action cannot be performed on a cluster that is not using a service principal + * + * @summary This action cannot be performed on a cluster that is not using a service principal + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetServicePrincipalProfile.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function resetServicePrincipalProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { + clientId: "clientid", + secret: "secret", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetServicePrincipalProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetServicePrincipalProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolvePrivateLinkServiceIdPostSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolvePrivateLinkServiceIdPostSample.js new file mode 100644 index 000000000000..8fa466c4998e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolvePrivateLinkServiceIdPostSample.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets the private link service ID for the specified managed cluster. + * + * @summary Gets the private link service ID for the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json + */ +async function resolveThePrivateLinkServiceIdForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { name: "management" }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.resolvePrivateLinkServiceId.post( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resolveThePrivateLinkServiceIdForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js new file mode 100644 index 000000000000..e99122f3969f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the private link service ID for the specified managed cluster. + * + * @summary Gets the private link service ID for the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ResolvePrivateLinkServiceId.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function resolveThePrivateLinkServiceIdForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { name: "management" }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.resolvePrivateLinkServiceId.post( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resolveThePrivateLinkServiceIdForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/rotateClusterCertificates.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/rotateClusterCertificates.js new file mode 100644 index 000000000000..8b591182309c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/rotateClusterCertificates.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * + * @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersRotateClusterCertificates.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function rotateClusterCertificates() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateClusterCertificatesAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterCertificates().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/sample.env b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsCreateOrUpdateSample.js new file mode 100644 index 000000000000..0eb595d635a9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsCreateOrUpdateSample.js @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json + */ +async function createOrUpdateSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0", + }, + location: "westus", + tags: { key1: "val1", key2: "val2" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate(resourceGroupName, resourceName, parameters); + console.log(result); +} + +createOrUpdateSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsDeleteSample.js new file mode 100644 index 000000000000..97df22cfb2d0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsDeleteSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json + */ +async function deleteSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsGetSample.js new file mode 100644 index 000000000000..41fe30e7c999 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsGetSample.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a snapshot. + * + * @summary Gets a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json + */ +async function getSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, resourceName); + console.log(result); +} + +getSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListByResourceGroupSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListByResourceGroupSample.js new file mode 100644 index 000000000000..bbcfe270b194 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListByResourceGroupSample.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Lists snapshots in the specified subscription and resource group. + * + * @summary Lists snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json + */ +async function listSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup(resourceGroupName)) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListSample.js new file mode 100644 index 000000000000..3590082bc40a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsListSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Gets a list of snapshots in the specified subscription. + * + * @summary Gets a list of snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json + */ +async function listSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsUpdateTagsSample.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsUpdateTagsSample.js new file mode 100644 index 000000000000..46f890a23dab --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/snapshotsUpdateTagsSample.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to Updates tags on a snapshot. + * + * @summary Updates tags on a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json + */ +async function updateSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.updateTags(resourceGroupName, resourceName, parameters); + console.log(result); +} + +updateSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startAgentPool.js new file mode 100644 index 000000000000..0780151e860b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startAgentPool.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Start.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function startAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { powerState: { code: "Running" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +startAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startManagedCluster.js new file mode 100644 index 000000000000..c0a38c5e48fa --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/startManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * + * @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStart.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function startManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStartAndWait(resourceGroupName, resourceName); + console.log(result); +} + +startManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopAgentPool.js new file mode 100644 index 000000000000..ce63fdf520f0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopAgentPool.js @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Stop.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function stopAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { powerState: { code: "Stopped" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +stopAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopManagedCluster.js new file mode 100644 index 000000000000..602aa781a82b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/stopManagedCluster.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * + * @summary This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStop.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function stopManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStopAndWait(resourceGroupName, resourceName); + console.log(result); +} + +stopManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/submitNewCommand.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/submitNewCommand.js new file mode 100644 index 000000000000..38dddc196b31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/submitNewCommand.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @summary AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandRequest.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function submitNewCommand() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const requestPayload = { + clusterToken: "", + command: "kubectl apply -f ns.yaml", + context: "", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRunCommandAndWait( + resourceGroupName, + resourceName, + requestPayload + ); + console.log(result); +} + +submitNewCommand().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateAgentPool.js new file mode 100644 index 000000000000..f764ba5d3d43 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateAgentPool.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Update.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters = { + count: 3, + enableAutoScaling: true, + maxCount: 2, + minCount: 2, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + vmSize: "Standard_DS1_v2", + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateManagedClusterTags.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateManagedClusterTags.js new file mode 100644 index 000000000000..c35c2c855494 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateManagedClusterTags.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags on a managed cluster. + * + * @summary Updates tags on a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersUpdateTags.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateManagedClusterTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters = { tags: { archv3: "", tier: "testing" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginUpdateTagsAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updatePrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updatePrivateEndpointConnection.js new file mode 100644 index 000000000000..f1dbc72f8dd0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updatePrivateEndpointConnection.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates a private endpoint connection. + * + * @summary Updates a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsUpdate.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updatePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const parameters = { + privateLinkServiceConnectionState: { status: "Approved" }, + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +updatePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateSnapshotTags.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateSnapshotTags.js new file mode 100644 index 000000000000..e841a03b8f02 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/updateSnapshotTags.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags on a snapshot. + * + * @summary Updates tags on a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsUpdateTags.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function updateSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.updateTags(resourceGroupName, resourceName, parameters); + console.log(result); +} + +updateSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/upgradeAgentPoolNodeImageVersion.js b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/upgradeAgentPoolNodeImageVersion.js new file mode 100644 index 000000000000..5ad0efbfa5d0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/javascript/upgradeAgentPoolNodeImageVersion.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * + * @summary Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsUpgradeNodeImageVersion.json + */ +const { ContainerServiceClient } = require("@azure/arm-containerservice"); +const { DefaultAzureCredential } = require("@azure/identity"); + +async function upgradeAgentPoolNodeImageVersion() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginUpgradeNodeImageVersionAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +upgradeAgentPoolNodeImageVersion().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/README.md b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/README.md new file mode 100644 index 000000000000..7f13c6efc210 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/README.md @@ -0,0 +1,313 @@ +# client library samples for TypeScript (Beta) + +These sample programs show how to use the TypeScript client libraries for in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [agentPoolsCreateOrUpdateSample.ts][agentpoolscreateorupdatesample] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json | +| [agentPoolsDeleteSample.ts][agentpoolsdeletesample] | Deletes an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json | +| [agentPoolsGetAvailableAgentPoolVersionsSample.ts][agentpoolsgetavailableagentpoolversionssample] | See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [agentPoolsGetSample.ts][agentpoolsgetsample] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json | +| [agentPoolsGetUpgradeProfileSample.ts][agentpoolsgetupgradeprofilesample] | Gets the upgrade profile for an agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json | +| [agentPoolsListSample.ts][agentpoolslistsample] | Gets a list of agent pools in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json | +| [agentPoolsUpgradeNodeImageVersionSample.ts][agentpoolsupgradenodeimageversionsample] | Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json | +| [commandFailedResult.ts][commandfailedresult] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultFailed.json | +| [commandSucceedResult.ts][commandsucceedresult] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultSucceed.json | +| [createAgentPoolUsingAnAgentPoolSnapshot.ts][createagentpoolusinganagentpoolsnapshot] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Snapshot.json | +| [createAgentPoolWithEncryptionAtHostEnabled.ts][createagentpoolwithencryptionathostenabled] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json | +| [createAgentPoolWithEphemeralOSDisk.ts][createagentpoolwithephemeralosdisk] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Ephemeral.json | +| [createAgentPoolWithFipsEnabledOS.ts][createagentpoolwithfipsenabledos] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableFIPS.json | +| [createAgentPoolWithGpumig.ts][createagentpoolwithgpumig] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_GPUMIG.json | +| [createAgentPoolWithKrustletAndTheWasiRuntime.ts][createagentpoolwithkrustletandthewasiruntime] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_WasmWasi.json | +| [createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts][createagentpoolwithkubeletconfigandlinuxosconfig] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_CustomNodeConfig.json | +| [createAgentPoolWithOssku.ts][createagentpoolwithossku] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_OSSKU.json | +| [createAgentPoolWithPpg.ts][createagentpoolwithppg] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_PPG.json | +| [createAgentPoolWithUltraSsdEnabled.ts][createagentpoolwithultrassdenabled] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableUltraSSD.json | +| [createManagedClusterUsingAnAgentPoolSnapshot.ts][createmanagedclusterusinganagentpoolsnapshot] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Snapshot.json | +| [createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts][createmanagedclusterwithaksmanagednatgatewayasoutboundtype] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_ManagedNATGateway.json | +| [createManagedClusterWithEncryptionAtHostEnabled.ts][createmanagedclusterwithencryptionathostenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json | +| [createManagedClusterWithFipsEnabledOS.ts][createmanagedclusterwithfipsenabledos] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnabledFIPS.json | +| [createManagedClusterWithGpumig.ts][createmanagedclusterwithgpumig] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_GPUMIG.json | +| [createManagedClusterWithHttpProxyConfigured.ts][createmanagedclusterwithhttpproxyconfigured] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_HTTPProxy.json | +| [createManagedClusterWithNodePublicIPPrefix.ts][createmanagedclusterwithnodepublicipprefix] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json | +| [createManagedClusterWithOssku.ts][createmanagedclusterwithossku] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_OSSKU.json | +| [createManagedClusterWithPodIdentityEnabled.ts][createmanagedclusterwithpodidentityenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PodIdentity.json | +| [createManagedClusterWithPpg.ts][createmanagedclusterwithppg] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PPG.json | +| [createManagedClusterWithRunCommandDisabled.ts][createmanagedclusterwithruncommanddisabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DisableRunCommand.json | +| [createManagedClusterWithSecurityProfileConfigured.ts][createmanagedclusterwithsecurityprofileconfigured] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_SecurityProfile.json | +| [createManagedClusterWithUltraSsdEnabled.ts][createmanagedclusterwithultrassdenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableUltraSSD.json | +| [createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts][createmanagedclusterwithuserassignednatgatewayasoutboundtype] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json | +| [createManagedPrivateClusterWithFqdnSubdomainSpecified.ts][createmanagedprivateclusterwithfqdnsubdomainspecified] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json | +| [createManagedPrivateClusterWithPublicFqdnSpecified.ts][createmanagedprivateclusterwithpublicfqdnspecified] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json | +| [createOrUpdateAadManagedClusterWithEnableAzureRbac.ts][createorupdateaadmanagedclusterwithenableazurerbac] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json | +| [createOrUpdateAgentPool.ts][createorupdateagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Update.json | +| [createOrUpdateMaintenanceConfiguration.ts][createorupdatemaintenanceconfiguration] | Creates or updates a maintenance configuration in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsCreate_Update.json | +| [createOrUpdateManagedCluster.ts][createorupdatemanagedcluster] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Update.json | +| [createOrUpdateManagedClusterWithDualStackNetworking.ts][createorupdatemanagedclusterwithdualstacknetworking] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DualStackNetworking.json | +| [createOrUpdateManagedClusterWithEnableAhub.ts][createorupdatemanagedclusterwithenableahub] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithAHUB.json | +| [createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts][createorupdatemanagedclusterwithwindowsgmsaenabled] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json | +| [createOrUpdateSnapshot.ts][createorupdatesnapshot] | Creates or updates a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsCreate.json | +| [createSpotAgentPool.ts][createspotagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Spot.json | +| [deleteAgentPool.ts][deleteagentpool] | Deletes an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsDelete.json | +| [deleteMaintenanceConfiguration.ts][deletemaintenanceconfiguration] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsDelete.json | +| [deleteManagedCluster.ts][deletemanagedcluster] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersDelete.json | +| [deletePrivateEndpointConnection.ts][deleteprivateendpointconnection] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsDelete.json | +| [deleteSnapshot.ts][deletesnapshot] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsDelete.json | +| [getAgentPool.ts][getagentpool] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGet.json | +| [getAvailableVersionsForAgentPool.ts][getavailableversionsforagentpool] | See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [getContainerServiceOSOptions.ts][getcontainerserviceosoptions] | Gets supported OS options in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ContainerServiceGetOSOptions.json | +| [getMaintenanceConfiguration.ts][getmaintenanceconfiguration] | Gets the specified maintenance configuration of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsGet.json | +| [getManagedCluster.ts][getmanagedcluster] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGet.json | +| [getManagedClustersByResourceGroup.ts][getmanagedclustersbyresourcegroup] | Lists managed clusters in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersListByResourceGroup.json | +| [getPrivateEndpointConnection.ts][getprivateendpointconnection] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsGet.json | +| [getSnapshot.ts][getsnapshot] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsGet.json | +| [getUpgradeProfileForAgentPool.ts][getupgradeprofileforagentpool] | Gets the upgrade profile for an agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetUpgradeProfile.json | +| [getUpgradeProfileForManagedCluster.ts][getupgradeprofileformanagedcluster] | Gets the upgrade profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGetUpgradeProfile.json | +| [listAgentPoolsByManagedCluster.ts][listagentpoolsbymanagedcluster] | Gets a list of agent pools in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsList.json | +| [listAvailableOperationsForTheContainerServiceResourceProvider.ts][listavailableoperationsforthecontainerserviceresourceprovider] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/Operation_List.json | +| [listMaintenanceConfigurationsByManagedCluster.ts][listmaintenanceconfigurationsbymanagedcluster] | Gets a list of maintenance configurations in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsList.json | +| [listManagedClusters.ts][listmanagedclusters] | Gets a list of managed clusters in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersList.json | +| [listOutboundNetworkDependenciesEndpointsByManagedCluster.ts][listoutboundnetworkdependenciesendpointsbymanagedcluster] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/OutboundNetworkDependenciesEndpointsList.json | +| [listPrivateEndpointConnectionsByManagedCluster.ts][listprivateendpointconnectionsbymanagedcluster] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsList.json | +| [listPrivateLinkResourcesByManagedCluster.ts][listprivatelinkresourcesbymanagedcluster] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateLinkResourcesList.json | +| [listSnapshots.ts][listsnapshots] | Gets a list of snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsList.json | +| [listSnapshotsByResourceGroup.ts][listsnapshotsbyresourcegroup] | Lists snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsListByResourceGroup.json | +| [maintenanceConfigurationsCreateOrUpdateSample.ts][maintenanceconfigurationscreateorupdatesample] | Creates or updates a maintenance configuration in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json | +| [maintenanceConfigurationsDeleteSample.ts][maintenanceconfigurationsdeletesample] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json | +| [maintenanceConfigurationsGetSample.ts][maintenanceconfigurationsgetsample] | Gets the specified maintenance configuration of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json | +| [maintenanceConfigurationsListByManagedClusterSample.ts][maintenanceconfigurationslistbymanagedclustersample] | Gets a list of maintenance configurations in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json | +| [managedClusterSnapshotsCreateOrUpdateSample.ts][managedclustersnapshotscreateorupdatesample] | Creates or updates a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json | +| [managedClusterSnapshotsDeleteSample.ts][managedclustersnapshotsdeletesample] | Deletes a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json | +| [managedClusterSnapshotsGetSample.ts][managedclustersnapshotsgetsample] | Gets a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json | +| [managedClusterSnapshotsListByResourceGroupSample.ts][managedclustersnapshotslistbyresourcegroupsample] | Lists managed cluster snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json | +| [managedClusterSnapshotsListSample.ts][managedclustersnapshotslistsample] | Gets a list of managed cluster snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json | +| [managedClusterSnapshotsUpdateTagsSample.ts][managedclustersnapshotsupdatetagssample] | Updates tags on a managed cluster snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json | +| [managedClustersCreateOrUpdateSample.ts][managedclusterscreateorupdatesample] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json | +| [managedClustersDeleteSample.ts][managedclustersdeletesample] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json | +| [managedClustersGetAccessProfileSample.ts][managedclustersgetaccessprofilesample] | **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json | +| [managedClustersGetCommandResultSample.ts][managedclustersgetcommandresultsample] | Gets the results of a command which has been run on the Managed Cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json | +| [managedClustersGetOSOptionsSample.ts][managedclustersgetosoptionssample] | Gets supported OS options in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json | +| [managedClustersGetSample.ts][managedclustersgetsample] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json | +| [managedClustersGetUpgradeProfileSample.ts][managedclustersgetupgradeprofilesample] | Gets the upgrade profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json | +| [managedClustersListByResourceGroupSample.ts][managedclusterslistbyresourcegroupsample] | Lists managed clusters in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json | +| [managedClustersListClusterAdminCredentialsSample.ts][managedclusterslistclusteradmincredentialssample] | Lists the admin credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListClusterMonitoringUserCredentialsSample.ts][managedclusterslistclustermonitoringusercredentialssample] | Lists the cluster monitoring user credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListClusterUserCredentialsSample.ts][managedclusterslistclusterusercredentialssample] | Lists the user credentials of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json | +| [managedClustersListOutboundNetworkDependenciesEndpointsSample.ts][managedclusterslistoutboundnetworkdependenciesendpointssample] | Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json | +| [managedClustersListSample.ts][managedclusterslistsample] | Gets a list of managed clusters in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json | +| [managedClustersResetAadProfileSample.ts][managedclustersresetaadprofilesample] | Reset the AAD Profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json | +| [managedClustersResetServicePrincipalProfileSample.ts][managedclustersresetserviceprincipalprofilesample] | This action cannot be performed on a cluster that is not using a service principal x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json | +| [managedClustersRotateClusterCertificatesSample.ts][managedclustersrotateclustercertificatessample] | See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json | +| [managedClustersRotateServiceAccountSigningKeysSample.ts][managedclustersrotateserviceaccountsigningkeyssample] | Rotates the service account signing keys of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json | +| [managedClustersRunCommandSample.ts][managedclustersruncommandsample] | AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json | +| [managedClustersStartSample.ts][managedclustersstartsample] | See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json | +| [managedClustersStopSample.ts][managedclustersstopsample] | This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json | +| [managedClustersUpdateTagsSample.ts][managedclustersupdatetagssample] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json | +| [operationsListSample.ts][operationslistsample] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionsUpdateSample.ts][privateendpointconnectionsupdatesample] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json | +| [privateLinkResourcesListSample.ts][privatelinkresourceslistsample] | To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json | +| [resetAadProfile.ts][resetaadprofile] | Reset the AAD Profile of a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetAADProfile.json | +| [resetServicePrincipalProfile.ts][resetserviceprincipalprofile] | This action cannot be performed on a cluster that is not using a service principal x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetServicePrincipalProfile.json | +| [resolvePrivateLinkServiceIdPostSample.ts][resolveprivatelinkserviceidpostsample] | Gets the private link service ID for the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json | +| [resolveThePrivateLinkServiceIdForManagedCluster.ts][resolvetheprivatelinkserviceidformanagedcluster] | Gets the private link service ID for the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ResolvePrivateLinkServiceId.json | +| [rotateClusterCertificates.ts][rotateclustercertificates] | See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersRotateClusterCertificates.json | +| [snapshotsCreateOrUpdateSample.ts][snapshotscreateorupdatesample] | Creates or updates a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json | +| [snapshotsListByResourceGroupSample.ts][snapshotslistbyresourcegroupsample] | Lists snapshots in the specified subscription and resource group. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json | +| [snapshotsListSample.ts][snapshotslistsample] | Gets a list of snapshots in the specified subscription. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json | +| [snapshotsUpdateTagsSample.ts][snapshotsupdatetagssample] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json | +| [startAgentPool.ts][startagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Start.json | +| [startManagedCluster.ts][startmanagedcluster] | See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStart.json | +| [stopAgentPool.ts][stopagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Stop.json | +| [stopManagedCluster.ts][stopmanagedcluster] | This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStop.json | +| [submitNewCommand.ts][submitnewcommand] | AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandRequest.json | +| [updateAgentPool.ts][updateagentpool] | Creates or updates an agent pool in the specified managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Update.json | +| [updateManagedClusterTags.ts][updatemanagedclustertags] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersUpdateTags.json | +| [updatePrivateEndpointConnection.ts][updateprivateendpointconnection] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsUpdate.json | +| [updateSnapshotTags.ts][updatesnapshottags] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsUpdateTags.json | +| [upgradeAgentPoolNodeImageVersion.ts][upgradeagentpoolnodeimageversion] | Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsUpgradeNodeImageVersion.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://nodejs.org/about/releases/). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/agentPoolsCreateOrUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +npx cross-env node dist/agentPoolsCreateOrUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[agentpoolscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsCreateOrUpdateSample.ts +[agentpoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsDeleteSample.ts +[agentpoolsgetavailableagentpoolversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts +[agentpoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetSample.ts +[agentpoolsgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetUpgradeProfileSample.ts +[agentpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsListSample.ts +[agentpoolsupgradenodeimageversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts +[commandfailedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandFailedResult.ts +[commandsucceedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandSucceedResult.ts +[createagentpoolusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts +[createagentpoolwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts +[createagentpoolwithephemeralosdisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEphemeralOSDisk.ts +[createagentpoolwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithFipsEnabledOS.ts +[createagentpoolwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithGpumig.ts +[createagentpoolwithkrustletandthewasiruntime]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts +[createagentpoolwithkubeletconfigandlinuxosconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts +[createagentpoolwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithOssku.ts +[createagentpoolwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithPpg.ts +[createagentpoolwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithUltraSsdEnabled.ts +[createmanagedclusterusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts +[createmanagedclusterwithaksmanagednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts +[createmanagedclusterwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts +[createmanagedclusterwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithFipsEnabledOS.ts +[createmanagedclusterwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithGpumig.ts +[createmanagedclusterwithhttpproxyconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithHttpProxyConfigured.ts +[createmanagedclusterwithnodepublicipprefix]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts +[createmanagedclusterwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithOssku.ts +[createmanagedclusterwithpodidentityenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPodIdentityEnabled.ts +[createmanagedclusterwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPpg.ts +[createmanagedclusterwithruncommanddisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithRunCommandDisabled.ts +[createmanagedclusterwithsecurityprofileconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts +[createmanagedclusterwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUltraSsdEnabled.ts +[createmanagedclusterwithuserassignednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts +[createmanagedprivateclusterwithfqdnsubdomainspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts +[createmanagedprivateclusterwithpublicfqdnspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts +[createorupdateaadmanagedclusterwithenableazurerbac]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts +[createorupdateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAgentPool.ts +[createorupdatemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateMaintenanceConfiguration.ts +[createorupdatemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedCluster.ts +[createorupdatemanagedclusterwithdualstacknetworking]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts +[createorupdatemanagedclusterwithenableahub]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts +[createorupdatemanagedclusterwithwindowsgmsaenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts +[createorupdatesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateSnapshot.ts +[createspotagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createSpotAgentPool.ts +[deleteagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteAgentPool.ts +[deletemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteMaintenanceConfiguration.ts +[deletemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteManagedCluster.ts +[deleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deletePrivateEndpointConnection.ts +[deletesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteSnapshot.ts +[getagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAgentPool.ts +[getavailableversionsforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAvailableVersionsForAgentPool.ts +[getcontainerserviceosoptions]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getContainerServiceOSOptions.ts +[getmaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getMaintenanceConfiguration.ts +[getmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedCluster.ts +[getmanagedclustersbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedClustersByResourceGroup.ts +[getprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getPrivateEndpointConnection.ts +[getsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getSnapshot.ts +[getupgradeprofileforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForAgentPool.ts +[getupgradeprofileformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForManagedCluster.ts +[listagentpoolsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAgentPoolsByManagedCluster.ts +[listavailableoperationsforthecontainerserviceresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts +[listmaintenanceconfigurationsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts +[listmanagedclusters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listManagedClusters.ts +[listoutboundnetworkdependenciesendpointsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts +[listprivateendpointconnectionsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts +[listprivatelinkresourcesbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateLinkResourcesByManagedCluster.ts +[listsnapshots]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshots.ts +[listsnapshotsbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshotsByResourceGroup.ts +[maintenanceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts +[maintenanceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsDeleteSample.ts +[maintenanceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsGetSample.ts +[maintenanceconfigurationslistbymanagedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts +[managedclustersnapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsCreateOrUpdateSample.ts +[managedclustersnapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsDeleteSample.ts +[managedclustersnapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsGetSample.ts +[managedclustersnapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListByResourceGroupSample.ts +[managedclustersnapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListSample.ts +[managedclustersnapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsUpdateTagsSample.ts +[managedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersCreateOrUpdateSample.ts +[managedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersDeleteSample.ts +[managedclustersgetaccessprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetAccessProfileSample.ts +[managedclustersgetcommandresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetCommandResultSample.ts +[managedclustersgetosoptionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetOSOptionsSample.ts +[managedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetSample.ts +[managedclustersgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetUpgradeProfileSample.ts +[managedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListByResourceGroupSample.ts +[managedclusterslistclusteradmincredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterAdminCredentialsSample.ts +[managedclusterslistclustermonitoringusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts +[managedclusterslistclusterusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterUserCredentialsSample.ts +[managedclusterslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts +[managedclusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListSample.ts +[managedclustersresetaadprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetAadProfileSample.ts +[managedclustersresetserviceprincipalprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetServicePrincipalProfileSample.ts +[managedclustersrotateclustercertificatessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateClusterCertificatesSample.ts +[managedclustersrotateserviceaccountsigningkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateServiceAccountSigningKeysSample.ts +[managedclustersruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRunCommandSample.ts +[managedclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStartSample.ts +[managedclustersstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStopSample.ts +[managedclustersupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersUpdateTagsSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/operationsListSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsListSample.ts +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts +[privatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateLinkResourcesListSample.ts +[resetaadprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetAadProfile.ts +[resetserviceprincipalprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetServicePrincipalProfile.ts +[resolveprivatelinkserviceidpostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolvePrivateLinkServiceIdPostSample.ts +[resolvetheprivatelinkserviceidformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts +[rotateclustercertificates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/rotateClusterCertificates.ts +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsCreateOrUpdateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsGetSample.ts +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListByResourceGroupSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListSample.ts +[snapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsUpdateTagsSample.ts +[startagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startAgentPool.ts +[startmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startManagedCluster.ts +[stopagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopAgentPool.ts +[stopmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopManagedCluster.ts +[submitnewcommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/submitNewCommand.ts +[updateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateAgentPool.ts +[updatemanagedclustertags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateManagedClusterTags.ts +[updateprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updatePrivateEndpointConnection.ts +[updatesnapshottags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateSnapshotTags.ts +[upgradeagentpoolnodeimageversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/upgradeAgentPoolNodeImageVersion.ts +[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/package.json b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/package.json new file mode 100644 index 000000000000..8a6b75f0c69d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-containerservice-ts-beta", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript (Beta)", + "engines": { + "node": ">=12.0.0" + }, + "scripts": { + "build": "tsc", + "prebuild": "rimraf dist/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Azure/azure-sdk-for-js.git", + "directory": "sdk/containerservice/arm-containerservice" + }, + "keywords": [ + "node", + "azure", + "typescript", + "browser", + "isomorphic" + ], + "author": "Microsoft Corporation", + "license": "MIT", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservice", + "dependencies": { + "@azure/arm-containerservice": "next", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "typescript": "~4.4.0", + "rimraf": "latest" + } +} diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/sample.env b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/sample.env @@ -0,0 +1,4 @@ +# App registration secret for AAD authentication +AZURE_CLIENT_SECRET= +AZURE_CLIENT_ID= +AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7003e928438a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsCreateOrUpdateSample.ts @@ -0,0 +1,646 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsAssociate_CRG.json + */ +async function associateAgentPoolWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/CapacityReservationGroups/crg1", + count: 3, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +associateAgentPoolWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Snapshot.json + */ +async function createAgentPoolUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + }, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolUsingAnAgentPoolSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_DedicatedHostGroup.json + */ +async function createAgentPoolWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ +async function createAgentPoolWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableEncryptionAtHost: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEncryptionAtHostEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Ephemeral.json + */ +async function createAgentPoolWithEphemeralOSDisk() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + orchestratorVersion: "", + osDiskSizeGB: 64, + osDiskType: "Ephemeral", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEphemeralOSDisk().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableFIPS.json + */ +async function createAgentPoolWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithFipsEnabledOS().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_GPUMIG.json + */ +async function createAgentPoolWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + gpuInstanceProfile: "MIG2g", + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_ND96asr_v4" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithGpumig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_WasmWasi.json + */ +async function createAgentPoolWithKrustletAndTheWasiRuntime() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2", + workloadRuntime: "WasmWasi" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKrustletAndTheWasiRuntime().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_CustomNodeConfig.json + */ +async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKubeletConfigAndLinuxOSConfig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_MessageOfTheDay.json + */ +async function createAgentPoolWithMessageOfTheDay() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + messageOfTheDay: "Zm9vCg==", + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithMessageOfTheDay().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_OSSKU.json + */ +async function createAgentPoolWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithOssku().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_PPG.json + */ +async function createAgentPoolWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + orchestratorVersion: "", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithPpg().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_EnableUltraSSD.json + */ +async function createAgentPoolWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableUltraSSD: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithUltraSsdEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Spot.json + */ +async function createSpotAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createSpotAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsCreate_Update.json + */ +async function createOrUpdateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + mode: "User", + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createOrUpdateAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Start.json + */ +async function startAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { powerState: { code: "Running" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +startAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Stop.json + */ +async function stopAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { powerState: { code: "Stopped" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +stopAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPools_Update.json + */ +async function updateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableAutoScaling: true, + maxCount: 2, + minCount: 2, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsDeleteSample.ts new file mode 100644 index 000000000000..c47f40aaec27 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsDeleteSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete.json + */ +async function deleteAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); + +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsDelete_IgnorePodDisruptionBudget.json + */ +async function deleteAgentPoolByIgnoringPodDisruptionBudget() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPoolByIgnoringPodDisruptionBudget().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts new file mode 100644 index 000000000000..facb4a7c82ef --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * + * @summary See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ +async function getAvailableVersionsForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getAvailableAgentPoolVersions( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getAvailableVersionsForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetSample.ts new file mode 100644 index 000000000000..811aef2b4585 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified managed cluster agent pool. + * + * @summary Gets the specified managed cluster agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGet.json + */ +async function getAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.get( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetUpgradeProfileSample.ts new file mode 100644 index 000000000000..0f8327a4d89f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsGetUpgradeProfileSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the upgrade profile for an agent pool. + * + * @summary Gets the upgrade profile for an agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsGetUpgradeProfile.json + */ +async function getUpgradeProfileForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getUpgradeProfile( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getUpgradeProfileForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsListSample.ts new file mode 100644 index 000000000000..9a3c03bdbc8e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsListSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of agent pools in the specified managed cluster. + * + * @summary Gets a list of agent pools in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsList.json + */ +async function listAgentPoolsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.agentPools.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAgentPoolsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts new file mode 100644 index 000000000000..127826f80145 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * + * @summary Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/AgentPoolsUpgradeNodeImageVersion.json + */ +async function upgradeAgentPoolNodeImageVersion() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginUpgradeNodeImageVersionAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +upgradeAgentPoolNodeImageVersion().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandFailedResult.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandFailedResult.ts new file mode 100644 index 000000000000..9cbe6e5acbf3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandFailedResult.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultFailed.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function commandFailedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandFailedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandSucceedResult.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandSucceedResult.ts new file mode 100644 index 000000000000..85dcad6433e6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/commandSucceedResult.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandResultSucceed.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function commandSucceedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandSucceedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts new file mode 100644 index 000000000000..5a603cb40100 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Snapshot.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + }, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolUsingAnAgentPoolSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts new file mode 100644 index 000000000000..615937aecc3d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableEncryptionAtHost: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEncryptionAtHostEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEphemeralOSDisk.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEphemeralOSDisk.ts new file mode 100644 index 000000000000..d6ae50f316bf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithEphemeralOSDisk.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Ephemeral.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithEphemeralOSDisk() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + orchestratorVersion: "", + osDiskSizeGB: 64, + osDiskType: "Ephemeral", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithEphemeralOSDisk().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithFipsEnabledOS.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithFipsEnabledOS.ts new file mode 100644 index 000000000000..10b8598d5f1c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithFipsEnabledOS.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableFIPS.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableFips: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithFipsEnabledOS().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithGpumig.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithGpumig.ts new file mode 100644 index 000000000000..91d06caaed3b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithGpumig.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_GPUMIG.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + gpuInstanceProfile: "MIG2g", + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_ND96asr_v4" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithGpumig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts new file mode 100644 index 000000000000..4f1575c18522 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_WasmWasi.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithKrustletAndTheWasiRuntime() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + mode: "User", + orchestratorVersion: "", + osDiskSizeGB: 64, + osType: "Linux", + vmSize: "Standard_DS2_v2", + workloadRuntime: "WasmWasi" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKrustletAndTheWasiRuntime().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts new file mode 100644 index 000000000000..e3757240cf85 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_CustomNodeConfig.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithKubeletConfigAndLinuxOSConfig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithOssku.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithOssku.ts new file mode 100644 index 000000000000..f51c123aa8de --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithOssku.ts @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_OSSKU.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + kubeletConfig: { + allowedUnsafeSysctls: ["kernel.msg*", "net.core.somaxconn"], + cpuCfsQuota: true, + cpuCfsQuotaPeriod: "200ms", + cpuManagerPolicy: "static", + failSwapOn: false, + imageGcHighThreshold: 90, + imageGcLowThreshold: 70, + topologyManagerPolicy: "best-effort" + }, + linuxOSConfig: { + swapFileSizeMB: 1500, + sysctls: { + kernelThreadsMax: 99999, + netCoreWmemDefault: 12345, + netIpv4IpLocalPortRange: "20000 60000", + netIpv4TcpTwReuse: true + }, + transparentHugePageDefrag: "madvise", + transparentHugePageEnabled: "always" + }, + orchestratorVersion: "", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithOssku().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithPpg.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithPpg.ts new file mode 100644 index 000000000000..1267606f3a53 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithPpg.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_PPG.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + orchestratorVersion: "", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithPpg().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithUltraSsdEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithUltraSsdEnabled.ts new file mode 100644 index 000000000000..0e0fb907fc64 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createAgentPoolWithUltraSsdEnabled.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_EnableUltraSSD.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createAgentPoolWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableUltraSSD: true, + orchestratorVersion: "", + osType: "Linux", + vmSize: "Standard_DS2_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createAgentPoolWithUltraSsdEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts new file mode 100644 index 000000000000..5ba30e202d27 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts @@ -0,0 +1,80 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Snapshot.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + }, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAnAgentPoolSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts new file mode 100644 index 000000000000..181970a8528a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_ManagedNATGateway.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + natGatewayProfile: { managedOutboundIPProfile: { count: 2 } }, + outboundType: "managedNATGateway" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithAksManagedNatGatewayAsOutboundType().catch( + console.error +); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts new file mode 100644 index 000000000000..e505c2f2f7e7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithEncryptionAtHostEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithFipsEnabledOS.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithFipsEnabledOS.ts new file mode 100644 index 000000000000..5617fca5d656 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithFipsEnabledOS.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnabledFIPS.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithFipsEnabledOS().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithGpumig.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithGpumig.ts new file mode 100644 index 000000000000..6f3a230b00f8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithGpumig.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_GPUMIG.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + gpuInstanceProfile: "MIG3g", + mode: "System", + osType: "Linux", + vmSize: "Standard_ND96asr_v4" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithGpumig().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithHttpProxyConfigured.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithHttpProxyConfigured.ts new file mode 100644 index 000000000000..4e17d164b0bb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithHttpProxyConfigured.ts @@ -0,0 +1,81 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_HTTPProxy.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithHttpProxyConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithHttpProxyConfigured().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts new file mode 100644 index 000000000000..46634263760a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithNodePublicIPPrefix() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + nodePublicIPPrefixID: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithNodePublicIPPrefix().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithOssku.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithOssku.ts new file mode 100644 index 000000000000..b21e4283e40e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithOssku.ts @@ -0,0 +1,82 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_OSSKU.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithOssku().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPodIdentityEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPodIdentityEnabled.ts new file mode 100644 index 000000000000..baa04d31a2bf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPodIdentityEnabled.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PodIdentity.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithPodIdentityEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + podIdentityProfile: { allowNetworkPluginKubenet: true, enabled: true }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPodIdentityEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPpg.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPpg.ts new file mode 100644 index 000000000000..af05f09ca833 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithPpg.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PPG.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPpg().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithRunCommandDisabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithRunCommandDisabled.ts new file mode 100644 index 000000000000..9fb35f651f81 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithRunCommandDisabled.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DisableRunCommand.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithRunCommandDisabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { disableRunCommand: true }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithRunCommandDisabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts new file mode 100644 index 000000000000..da11d929dade --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts @@ -0,0 +1,71 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_SecurityProfile.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithSecurityProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + securityProfile: { + azureDefender: { + enabled: true, + logAnalyticsWorkspaceResourceId: + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME" + } + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithSecurityProfileConfigured().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUltraSsdEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUltraSsdEnabled.ts new file mode 100644 index 000000000000..e5fb7f045345 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUltraSsdEnabled.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_EnableUltraSSD.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + enableUltraSSD: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUltraSsdEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts new file mode 100644 index 000000000000..646696e3e0f2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + outboundType: "userAssignedNATGateway" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUserAssignedNatGatewayAsOutboundType().catch( + console.error +); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts new file mode 100644 index 000000000000..75e255b95aa5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts @@ -0,0 +1,79 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + privateDNSZone: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io" + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + enablePodSecurityPolicy: true, + enableRbac: true, + fqdnSubdomain: "domain1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithFqdnSubdomainSpecified().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts new file mode 100644 index 000000000000..3e5da0c46707 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts @@ -0,0 +1,78 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createManagedPrivateClusterWithPublicFqdnSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + enablePrivateClusterPublicFqdn: true + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithPublicFqdnSpecified().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts new file mode 100644 index 000000000000..63110d7ea12f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts @@ -0,0 +1,77 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + aadProfile: { enableAzureRbac: true, managed: true }, + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateAadManagedClusterWithEnableAzureRbac().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAgentPool.ts new file mode 100644 index 000000000000..349b36b7e42e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateAgentPool.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Update.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + mode: "User", + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createOrUpdateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateMaintenanceConfiguration.ts new file mode 100644 index 000000000000..771591bddf3e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateMaintenanceConfiguration.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a maintenance configuration in the specified managed cluster. + * + * @summary Creates or updates a maintenance configuration in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsCreate_Update.json + */ +import { + MaintenanceConfiguration, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const parameters: MaintenanceConfiguration = { + notAllowedTime: [ + { + end: new Date("2020-11-30T12:00:00Z"), + start: new Date("2020-11-26T03:00:00Z") + } + ], + timeInWeek: [{ day: "Monday", hourSlots: [1, 2] }] + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.createOrUpdate( + resourceGroupName, + resourceName, + configName, + parameters + ); + console.log(result); +} + +createOrUpdateMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedCluster.ts new file mode 100644 index 000000000000..da3f2aa83499 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedCluster.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_Update.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false" + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts new file mode 100644 index 000000000000..299da4d06149 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_DualStackNetworking.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateManagedClusterWithDualStackNetworking() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false" + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + ipFamilies: ["IPv4", "IPv6"], + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithDualStackNetworking().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts new file mode 100644 index 000000000000..1acc1632c1a1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateManagedClusterWithEnableAhub() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + licenseType: "Windows_Server" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableAhub().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts new file mode 100644 index 000000000000..5ee8718cdaa0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + gmsaProfile: { enabled: true } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithWindowsGMsaEnabled().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateSnapshot.ts new file mode 100644 index 000000000000..0d67d5eb4bf5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createOrUpdateSnapshot.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsCreate.json + */ +import { Snapshot, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createOrUpdateSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: Snapshot = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0" + }, + location: "westus", + tags: { key1: "val1", key2: "val2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createSpotAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createSpotAgentPool.ts new file mode 100644 index 000000000000..189774c3f7d9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/createSpotAgentPool.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsCreate_Spot.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function createSpotAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + nodeLabels: { key1: "val1" }, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + tags: { name1: "val1" }, + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +createSpotAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteAgentPool.ts new file mode 100644 index 000000000000..245416a8635e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteAgentPool.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes an agent pool in the specified managed cluster. + * + * @summary Deletes an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsDelete.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginDeleteAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +deleteAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteMaintenanceConfiguration.ts new file mode 100644 index 000000000000..a06d13b5bc53 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteMaintenanceConfiguration.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a maintenance configuration. + * + * @summary Deletes a maintenance configuration. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsDelete.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.delete( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +deleteMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteManagedCluster.ts new file mode 100644 index 000000000000..0f9bb5c77ea6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a managed cluster. + * + * @summary Deletes a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersDelete.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginDeleteAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +deleteManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deletePrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deletePrivateEndpointConnection.ts new file mode 100644 index 000000000000..5b9e73a1a0fb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deletePrivateEndpointConnection.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a private endpoint connection. + * + * @summary Deletes a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsDelete.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deletePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +deletePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteSnapshot.ts new file mode 100644 index 000000000000..61aa8776211d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/deleteSnapshot.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsDelete.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function deleteSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAgentPool.ts new file mode 100644 index 000000000000..8788993c44fb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAgentPool.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the specified managed cluster agent pool. + * + * @summary Gets the specified managed cluster agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGet.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.get( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAvailableVersionsForAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAvailableVersionsForAgentPool.ts new file mode 100644 index 000000000000..ad6514519638 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getAvailableVersionsForAgentPool.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * + * @summary See [supported Kubernetes versions](https://docs.microsoft.com/azure/aks/supported-kubernetes-versions) for more details about the version lifecycle. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getAvailableVersionsForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getAvailableAgentPoolVersions( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getAvailableVersionsForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getContainerServiceOSOptions.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getContainerServiceOSOptions.ts new file mode 100644 index 000000000000..f42a58741c0a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getContainerServiceOSOptions.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets supported OS options in the specified subscription. + * + * @summary Gets supported OS options in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ContainerServiceGetOSOptions.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getContainerServiceOSOptions() { + const subscriptionId = "subid1"; + const location = "location1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getOSOptions(location); + console.log(result); +} + +getContainerServiceOSOptions().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getMaintenanceConfiguration.ts new file mode 100644 index 000000000000..bb4f4c8c3d80 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getMaintenanceConfiguration.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the specified maintenance configuration of a managed cluster. + * + * @summary Gets the specified maintenance configuration of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsGet.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.get( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +getMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedCluster.ts new file mode 100644 index 000000000000..3836bfe3a4d3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a managed cluster. + * + * @summary Gets a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGet.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.get( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedClustersByResourceGroup.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedClustersByResourceGroup.ts new file mode 100644 index 000000000000..dec78a9f2d26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getManagedClustersByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists managed clusters in the specified subscription and resource group. + * + * @summary Lists managed clusters in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersListByResourceGroup.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getManagedClustersByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getManagedClustersByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getPrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getPrivateEndpointConnection.ts new file mode 100644 index 000000000000..f8ab7dd6c387 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getPrivateEndpointConnection.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsGet.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getPrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +getPrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getSnapshot.ts new file mode 100644 index 000000000000..66dba8b551fa --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getSnapshot.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a snapshot. + * + * @summary Gets a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsGet.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, resourceName); + console.log(result); +} + +getSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForAgentPool.ts new file mode 100644 index 000000000000..b88f86b90221 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForAgentPool.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the upgrade profile for an agent pool. + * + * @summary Gets the upgrade profile for an agent pool. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsGetUpgradeProfile.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getUpgradeProfileForAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.getUpgradeProfile( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +getUpgradeProfileForAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForManagedCluster.ts new file mode 100644 index 000000000000..1531bad68b0c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/getUpgradeProfileForManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the upgrade profile of a managed cluster. + * + * @summary Gets the upgrade profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersGetUpgradeProfile.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function getUpgradeProfileForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getUpgradeProfile( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getUpgradeProfileForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAgentPoolsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAgentPoolsByManagedCluster.ts new file mode 100644 index 000000000000..c169b98e728d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAgentPoolsByManagedCluster.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of agent pools in the specified managed cluster. + * + * @summary Gets a list of agent pools in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listAgentPoolsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.agentPools.list( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listAgentPoolsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts new file mode 100644 index 000000000000..3f2872f40265 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of operations. + * + * @summary Gets a list of operations. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/Operation_List.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listAvailableOperationsForTheContainerServiceResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailableOperationsForTheContainerServiceResourceProvider().catch( + console.error +); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts new file mode 100644 index 000000000000..8851d5d4f366 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of maintenance configurations in the specified managed cluster. + * + * @summary Gets a list of maintenance configurations in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/MaintenanceConfigurationsList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listMaintenanceConfigurationsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.maintenanceConfigurations.listByManagedCluster( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listMaintenanceConfigurationsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listManagedClusters.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listManagedClusters.ts new file mode 100644 index 000000000000..db2d31fff72d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listManagedClusters.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of managed clusters in the specified subscription. + * + * @summary Gets a list of managed clusters in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listManagedClusters() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusters().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts new file mode 100644 index 000000000000..aa4127525805 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * + * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/OutboundNetworkDependenciesEndpointsList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listOutboundNetworkDependenciesEndpoints( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listOutboundNetworkDependenciesEndpointsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts new file mode 100644 index 000000000000..efc52f9b27b7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listPrivateEndpointConnectionsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.list( + resourceGroupName, + resourceName + ); + console.log(result); +} + +listPrivateEndpointConnectionsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateLinkResourcesByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateLinkResourcesByManagedCluster.ts new file mode 100644 index 000000000000..b6d6769d5a1f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listPrivateLinkResourcesByManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateLinkResourcesList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listPrivateLinkResourcesByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateLinkResources.list( + resourceGroupName, + resourceName + ); + console.log(result); +} + +listPrivateLinkResourcesByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshots.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshots.ts new file mode 100644 index 000000000000..886b67511f26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshots.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets a list of snapshots in the specified subscription. + * + * @summary Gets a list of snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsList.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshotsByResourceGroup.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshotsByResourceGroup.ts new file mode 100644 index 000000000000..902260abc84e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/listSnapshotsByResourceGroup.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Lists snapshots in the specified subscription and resource group. + * + * @summary Lists snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsListByResourceGroup.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function listSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..7cf14ecdfbad --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + MaintenanceConfiguration, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a maintenance configuration in the specified managed cluster. + * + * @summary Creates or updates a maintenance configuration in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsCreate_Update.json + */ +async function createOrUpdateMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const parameters: MaintenanceConfiguration = { + notAllowedTime: [ + { + end: new Date("2020-11-30T12:00:00Z"), + start: new Date("2020-11-26T03:00:00Z") + } + ], + timeInWeek: [{ day: "Monday", hourSlots: [1, 2] }] + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.createOrUpdate( + resourceGroupName, + resourceName, + configName, + parameters + ); + console.log(result); +} + +createOrUpdateMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsDeleteSample.ts new file mode 100644 index 000000000000..124b8c218cef --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a maintenance configuration. + * + * @summary Deletes a maintenance configuration. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsDelete.json + */ +async function deleteMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.delete( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +deleteMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsGetSample.ts new file mode 100644 index 000000000000..8b7da3fbd57a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the specified maintenance configuration of a managed cluster. + * + * @summary Gets the specified maintenance configuration of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsGet.json + */ +async function getMaintenanceConfiguration() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const configName = "default"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.maintenanceConfigurations.get( + resourceGroupName, + resourceName, + configName + ); + console.log(result); +} + +getMaintenanceConfiguration().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts new file mode 100644 index 000000000000..b36a0fc95aa2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of maintenance configurations in the specified managed cluster. + * + * @summary Gets a list of maintenance configurations in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/MaintenanceConfigurationsList.json + */ +async function listMaintenanceConfigurationsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.maintenanceConfigurations.listByManagedCluster( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listMaintenanceConfigurationsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..05d978e6cdf6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsCreateOrUpdateSample.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ManagedClusterSnapshot, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a managed cluster snapshot. + * + * @summary Creates or updates a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsCreate.json + */ +async function createOrUpdateManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: ManagedClusterSnapshot = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1" + }, + location: "westus", + tags: { key1: "val1", key2: "val2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.createOrUpdate( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsDeleteSample.ts new file mode 100644 index 000000000000..15fda4caf71c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a managed cluster snapshot. + * + * @summary Deletes a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsDelete.json + */ +async function deleteManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.delete( + resourceGroupName, + resourceName + ); + console.log(result); +} + +deleteManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsGetSample.ts new file mode 100644 index 000000000000..8bd0b216e15b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a managed cluster snapshot. + * + * @summary Gets a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsGet.json + */ +async function getManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.get( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedClusterSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..587f6fea5877 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists managed cluster snapshots in the specified subscription and resource group. + * + * @summary Lists managed cluster snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsListByResourceGroup.json + */ +async function listManagedClusterSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListSample.ts new file mode 100644 index 000000000000..d87223470e31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of managed cluster snapshots in the specified subscription. + * + * @summary Gets a list of managed cluster snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsList.json + */ +async function listManagedClusterSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusterSnapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusterSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsUpdateTagsSample.ts new file mode 100644 index 000000000000..45c64b81b9d7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClusterSnapshotsUpdateTagsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates tags on a managed cluster snapshot. + * + * @summary Updates tags on a managed cluster snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClusterSnapshotsUpdateTags.json + */ +async function updateManagedClusterSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: TagsObject = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusterSnapshots.updateTags( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..92cc04a789a2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersCreateOrUpdateSample.ts @@ -0,0 +1,1658 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ManagedCluster, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersAssociate_CRG.json + */ +async function associateManagedClusterWithCapacityReservationGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + capacityReservationGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/capacityReservationGroups/crg1", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +associateManagedClusterWithCapacityReservationGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_MCSnapshot.json + */ +async function createManagedClusterUsingAManagedClusterSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/managedclustersnapshots/snapshot1" + }, + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAManagedClusterSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Snapshot.json + */ +async function createManagedClusterUsingAnAgentPoolSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.ContainerService/snapshots/snapshot1" + }, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterUsingAnAgentPoolSnapshot().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_ManagedNATGateway.json + */ +async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + natGatewayProfile: { managedOutboundIPProfile: { count: 2 } }, + outboundType: "managedNATGateway" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithAksManagedNatGatewayAsOutboundType().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DedicatedHostGroup.json + */ +async function createManagedClusterWithDedicatedHostGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + hostGroupID: + "/subscriptions/subid1/resourcegroups/rg/providers/Microsoft.Compute/hostGroups/hostgroup1", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithDedicatedHostGroup().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + */ +async function createManagedClusterWithEncryptionAtHostEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithEncryptionAtHostEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnabledFIPS.json + */ +async function createManagedClusterWithFipsEnabledOS() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableFips: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: false, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithFipsEnabledOS().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_GPUMIG.json + */ +async function createManagedClusterWithGpumig() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + gpuInstanceProfile: "MIG3g", + mode: "System", + osType: "Linux", + vmSize: "Standard_ND96asr_v4" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithGpumig().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_HTTPProxy.json + */ +async function createManagedClusterWithHttpProxyConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithHttpProxyConfigured().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_NodePublicIPPrefix.json + */ +async function createManagedClusterWithNodePublicIPPrefix() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + nodePublicIPPrefixID: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/publicIPPrefixes/public-ip-prefix", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithNodePublicIPPrefix().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_OSSKU.json + */ +async function createManagedClusterWithOssku() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osSKU: "CBLMariner", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + httpProxyConfig: { + httpProxy: "http://myproxy.server.com:8080", + httpsProxy: "https://myproxy.server.com:8080", + noProxy: ["localhost", "127.0.0.1"], + trustedCa: "Q29uZ3JhdHMhIFlvdSBoYXZlIGZvdW5kIGEgaGlkZGVuIG1lc3NhZ2U=" + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithOssku().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PPG.json + */ +async function createManagedClusterWithPpg() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + proximityPlacementGroupID: + "/subscriptions/subid1/resourcegroups/rg1/providers//Microsoft.Compute/proximityPlacementGroups/ppg1", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPpg().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PodIdentity.json + */ +async function createManagedClusterWithPodIdentityEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + podIdentityProfile: { allowNetworkPluginKubenet: true, enabled: true }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithPodIdentityEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DisableRunCommand.json + */ +async function createManagedClusterWithRunCommandDisabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { disableRunCommand: true }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithRunCommandDisabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_SecurityProfile.json + */ +async function createManagedClusterWithSecurityProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + dnsPrefix: "dnsprefix1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + securityProfile: { + azureDefender: { + enabled: true, + logAnalyticsWorkspaceResourceId: + "/subscriptions/SUB_ID/resourcegroups/RG_NAME/providers/microsoft.operationalinsights/workspaces/WORKSPACE_NAME" + } + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithSecurityProfileConfigured().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_EnableUltraSSD.json + */ +async function createManagedClusterWithUltraSsdEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + enableUltraSSD: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUltraSsdEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_IngressProfile_WebAppRouting.json + */ +async function createManagedClusterWithWebAppRoutingIngressProfileConfigured() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + dnsPrefix: "dnsprefix1", + ingressProfile: { + webAppRouting: { + dnsZoneResourceId: + "/subscriptions/SUB_ID/resourceGroups/RG_NAME/providers/Microsoft.Network/dnszones/DNS_ZONE_NAME", + enabled: true + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithWebAppRoutingIngressProfileConfigured().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UserAssignedNATGateway.json + */ +async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableNodePublicIP: false, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerSku: "standard", + outboundType: "userAssignedNATGateway" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedClusterWithUserAssignedNatGatewayAsOutboundType().catch( + console.error +); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + */ +async function createManagedPrivateClusterWithPublicFqdnSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + enablePrivateClusterPublicFqdn: true + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithPublicFqdnSpecified().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + */ +async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + count: 3, + enableEncryptionAtHost: true, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS2_v2" + } + ], + apiServerAccessProfile: { + enablePrivateCluster: true, + privateDNSZone: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.Network/privateDnsZones/privatelink.location1.azmk8s.io" + }, + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + enablePodSecurityPolicy: true, + enableRbac: true, + fqdnSubdomain: "domain1", + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createManagedPrivateClusterWithFqdnSubdomainSpecified().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + */ +async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + aadProfile: { enableAzureRbac: true, managed: true }, + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateAadManagedClusterWithEnableAzureRbac().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_Update.json + */ +async function createOrUpdateManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false" + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedCluster().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithAHUB.json + */ +async function createOrUpdateManagedClusterWithEnableAhub() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + licenseType: "Windows_Server" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableAhub().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWithEnableNamespaceResources.json + */ +async function createOrUpdateManagedClusterWithEnableNamespaceResources() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enableNamespaceResources: true, + enablePodSecurityPolicy: true, + enableRbac: true, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithEnableNamespaceResources().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + */ +async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { scaleDownDelayAfterAdd: "15m", scanInterval: "20s" }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser", + gmsaProfile: { enabled: true } + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithWindowsGMsaEnabled().catch(console.error); + +/** + * This sample demonstrates how to Creates or updates a managed cluster. + * + * @summary Creates or updates a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersCreate_DualStackNetworking.json + */ +async function createOrUpdateManagedClusterWithDualStackNetworking() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedCluster = { + addonProfiles: {}, + agentPoolProfiles: [ + { + name: "nodepool1", + type: "VirtualMachineScaleSets", + availabilityZones: ["1", "2", "3"], + count: 3, + enableNodePublicIP: true, + mode: "System", + osType: "Linux", + scaleDownMode: "Deallocate", + vmSize: "Standard_DS1_v2" + } + ], + autoScalerProfile: { + balanceSimilarNodeGroups: "true", + expander: "priority", + maxNodeProvisionTime: "15m", + newPodScaleUpDelay: "1m", + scaleDownDelayAfterAdd: "15m", + scanInterval: "20s", + skipNodesWithSystemPods: "false" + }, + diskEncryptionSetID: + "/subscriptions/subid1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des", + dnsPrefix: "dnsprefix1", + enablePodSecurityPolicy: true, + enableRbac: true, + identity: { + type: "UserAssigned", + userAssignedIdentities: { + "/subscriptions/subid1/resourceGroups/rgName1/providers/MicrosoftManagedIdentity/userAssignedIdentities/identity1": {} + } + }, + kubernetesVersion: "", + linuxProfile: { + adminUsername: "azureuser", + ssh: { publicKeys: [{ keyData: "keydata" }] } + }, + location: "location1", + networkProfile: { + ipFamilies: ["IPv4", "IPv6"], + loadBalancerProfile: { managedOutboundIPs: { count: 2 } }, + loadBalancerSku: "standard", + outboundType: "loadBalancer" + }, + servicePrincipalProfile: { clientId: "clientid", secret: "secret" }, + sku: { name: "Basic", tier: "Free" }, + tags: { archv2: "", tier: "production" }, + windowsProfile: { + adminPassword: "replacePassword1234$", + adminUsername: "azureuser" + } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateManagedClusterWithDualStackNetworking().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersDeleteSample.ts new file mode 100644 index 000000000000..827fb080a3d0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersDeleteSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a managed cluster. + * + * @summary Deletes a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersDelete.json + */ +async function deleteManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginDeleteAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +deleteManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetAccessProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetAccessProfileSample.ts new file mode 100644 index 000000000000..230da6c17e69 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetAccessProfileSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + * + * @summary **WARNING**: This API will be deprecated. Instead use [ListClusterUserCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusterusercredentials) or [ListClusterAdminCredentials](https://docs.microsoft.com/rest/api/aks/managedclusters/listclusteradmincredentials) . + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetAccessProfile.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const roleName = "clusterUser"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getAccessProfile( + resourceGroupName, + resourceName, + roleName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetCommandResultSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetCommandResultSample.ts new file mode 100644 index 000000000000..85a22291d263 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetCommandResultSample.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultFailed.json + */ +async function commandFailedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandFailedResult().catch(console.error); + +/** + * This sample demonstrates how to Gets the results of a command which has been run on the Managed Cluster. + * + * @summary Gets the results of a command which has been run on the Managed Cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandResultSucceed.json + */ +async function commandSucceedResult() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const commandId = "def7b3ea71bd4f7e9d226ddbc0f00ad9"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getCommandResult( + resourceGroupName, + resourceName, + commandId + ); + console.log(result); +} + +commandSucceedResult().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetOSOptionsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetOSOptionsSample.ts new file mode 100644 index 000000000000..9cb65eb831b7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetOSOptionsSample.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets supported OS options in the specified subscription. + * + * @summary Gets supported OS options in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ContainerServiceGetOSOptions.json + */ +async function getContainerServiceOSOptions() { + const subscriptionId = "subid1"; + const location = "location1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getOSOptions(location); + console.log(result); +} + +getContainerServiceOSOptions().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetSample.ts new file mode 100644 index 000000000000..4ce0262330f8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a managed cluster. + * + * @summary Gets a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGet.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.get( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetUpgradeProfileSample.ts new file mode 100644 index 000000000000..adc996cb3720 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersGetUpgradeProfileSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the upgrade profile of a managed cluster. + * + * @summary Gets the upgrade profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersGetUpgradeProfile.json + */ +async function getUpgradeProfileForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.getUpgradeProfile( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getUpgradeProfileForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..98c996b33f7b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists managed clusters in the specified subscription and resource group. + * + * @summary Lists managed clusters in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListByResourceGroup.json + */ +async function getManagedClustersByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +getManagedClustersByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterAdminCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterAdminCredentialsSample.ts new file mode 100644 index 000000000000..ac76c5cfb484 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterAdminCredentialsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the admin credentials of a managed cluster. + * + * @summary Lists the admin credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterAdminCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts new file mode 100644 index 000000000000..60d8c6858b9d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the cluster monitoring user credentials of a managed cluster. + * + * @summary Lists the cluster monitoring user credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterMonitoringUserCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterUserCredentialsSample.ts new file mode 100644 index 000000000000..7efed75eaf87 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListClusterUserCredentialsSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists the user credentials of a managed cluster. + * + * @summary Lists the user credentials of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersListClusterCredentialResult.json + */ +async function getManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.listClusterUserCredentials( + resourceGroupName, + resourceName + ); + console.log(result); +} + +getManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts new file mode 100644 index 000000000000..806a62f7022b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts @@ -0,0 +1,36 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * + * @summary Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified managed cluster. The operation returns properties of each egress endpoint. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/OutboundNetworkDependenciesEndpointsList.json + */ +async function listOutboundNetworkDependenciesEndpointsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.listOutboundNetworkDependenciesEndpoints( + resourceGroupName, + resourceName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listOutboundNetworkDependenciesEndpointsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListSample.ts new file mode 100644 index 000000000000..d6b05fd3dc7d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of managed clusters in the specified subscription. + * + * @summary Gets a list of managed clusters in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersList.json + */ +async function listManagedClusters() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.managedClusters.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listManagedClusters().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetAadProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetAadProfileSample.ts new file mode 100644 index 000000000000..ef2925b7f302 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetAadProfileSample.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ManagedClusterAADProfile, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Reset the AAD Profile of a managed cluster. + * + * @summary Reset the AAD Profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetAADProfile.json + */ +async function resetAadProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedClusterAADProfile = { + clientAppID: "clientappid", + serverAppID: "serverappid", + serverAppSecret: "serverappsecret", + tenantID: "tenantid" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetAADProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetAadProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetServicePrincipalProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetServicePrincipalProfileSample.ts new file mode 100644 index 000000000000..f623b7fb8a3d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersResetServicePrincipalProfileSample.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + ManagedClusterServicePrincipalProfile, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This action cannot be performed on a cluster that is not using a service principal + * + * @summary This action cannot be performed on a cluster that is not using a service principal + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersResetServicePrincipalProfile.json + */ +async function resetServicePrincipalProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedClusterServicePrincipalProfile = { + clientId: "clientid", + secret: "secret" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetServicePrincipalProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetServicePrincipalProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateClusterCertificatesSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateClusterCertificatesSample.ts new file mode 100644 index 000000000000..9c5a1726c413 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateClusterCertificatesSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * + * @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateClusterCertificates.json + */ +async function rotateClusterCertificates() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateClusterCertificatesAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterCertificates().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateServiceAccountSigningKeysSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateServiceAccountSigningKeysSample.ts new file mode 100644 index 000000000000..9f82530282cd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRotateServiceAccountSigningKeysSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Rotates the service account signing keys of a managed cluster. + * + * @summary Rotates the service account signing keys of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersRotateServiceAccountSigningKeys.json + */ +async function rotateClusterServiceAccountSigningKeys() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateServiceAccountSigningKeysAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterServiceAccountSigningKeys().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRunCommandSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRunCommandSample.ts new file mode 100644 index 000000000000..05b21eac6a5e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersRunCommandSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + RunCommandRequest, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @summary AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/RunCommandRequest.json + */ +async function submitNewCommand() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const requestPayload: RunCommandRequest = { + clusterToken: "", + command: "kubectl apply -f ns.yaml", + context: "" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRunCommandAndWait( + resourceGroupName, + resourceName, + requestPayload + ); + console.log(result); +} + +submitNewCommand().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStartSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStartSample.ts new file mode 100644 index 000000000000..02c7a298052b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStartSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * + * @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStart.json + */ +async function startManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStartAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +startManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStopSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStopSample.ts new file mode 100644 index 000000000000..3ce68d5bdbe7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersStopSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * + * @summary This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersStop.json + */ +async function stopManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStopAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +stopManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersUpdateTagsSample.ts new file mode 100644 index 000000000000..b4dc51ccee8d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/managedClustersUpdateTagsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates tags on a managed cluster. + * + * @summary Updates tags on a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ManagedClustersUpdateTags.json + */ +async function updateManagedClusterTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: TagsObject = { tags: { archv3: "", tier: "testing" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginUpdateTagsAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/operationsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..945b99ec7e65 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/operationsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of operations. + * + * @summary Gets a list of operations. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/Operation_List.json + */ +async function listAvailableOperationsForTheContainerServiceResourceProvider() { + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.operations.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listAvailableOperationsForTheContainerServiceResourceProvider().catch( + console.error +); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..522255eafbc0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a private endpoint connection. + * + * @summary Deletes a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsDelete.json + */ +async function deletePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.beginDeleteAndWait( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +deletePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..7cc424e132af --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsGet.json + */ +async function getPrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + resourceGroupName, + resourceName, + privateEndpointConnectionName + ); + console.log(result); +} + +getPrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..490a04b3af1c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsList.json + */ +async function listPrivateEndpointConnectionsByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.list( + resourceGroupName, + resourceName + ); + console.log(result); +} + +listPrivateEndpointConnectionsByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..a12cbf44880c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateEndpointConnectionsUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateEndpointConnection, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates a private endpoint connection. + * + * @summary Updates a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateEndpointConnectionsUpdate.json + */ +async function updatePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const parameters: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { status: "Approved" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +updatePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateLinkResourcesListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateLinkResourcesListSample.ts new file mode 100644 index 000000000000..f6e517bd5e4d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/privateLinkResourcesListSample.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * + * @summary To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/PrivateLinkResourcesList.json + */ +async function listPrivateLinkResourcesByManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateLinkResources.list( + resourceGroupName, + resourceName + ); + console.log(result); +} + +listPrivateLinkResourcesByManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetAadProfile.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetAadProfile.ts new file mode 100644 index 000000000000..d452ca0f6cdb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetAadProfile.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Reset the AAD Profile of a managed cluster. + * + * @summary Reset the AAD Profile of a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetAADProfile.json + */ +import { + ManagedClusterAADProfile, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function resetAadProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedClusterAADProfile = { + clientAppID: "clientappid", + serverAppID: "serverappid", + serverAppSecret: "serverappsecret", + tenantID: "tenantid" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetAADProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetAadProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetServicePrincipalProfile.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetServicePrincipalProfile.ts new file mode 100644 index 000000000000..f33bf51974a0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resetServicePrincipalProfile.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This action cannot be performed on a cluster that is not using a service principal + * + * @summary This action cannot be performed on a cluster that is not using a service principal + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersResetServicePrincipalProfile.json + */ +import { + ManagedClusterServicePrincipalProfile, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function resetServicePrincipalProfile() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: ManagedClusterServicePrincipalProfile = { + clientId: "clientid", + secret: "secret" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginResetServicePrincipalProfileAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resetServicePrincipalProfile().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolvePrivateLinkServiceIdPostSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolvePrivateLinkServiceIdPostSample.ts new file mode 100644 index 000000000000..263a83b2233b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolvePrivateLinkServiceIdPostSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + PrivateLinkResource, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets the private link service ID for the specified managed cluster. + * + * @summary Gets the private link service ID for the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/ResolvePrivateLinkServiceId.json + */ +async function resolveThePrivateLinkServiceIdForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: PrivateLinkResource = { name: "management" }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.resolvePrivateLinkServiceId.post( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resolveThePrivateLinkServiceIdForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts new file mode 100644 index 000000000000..dff4d8559a95 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Gets the private link service ID for the specified managed cluster. + * + * @summary Gets the private link service ID for the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ResolvePrivateLinkServiceId.json + */ +import { + PrivateLinkResource, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function resolveThePrivateLinkServiceIdForManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: PrivateLinkResource = { name: "management" }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.resolvePrivateLinkServiceId.post( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +resolveThePrivateLinkServiceIdForManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/rotateClusterCertificates.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/rotateClusterCertificates.ts new file mode 100644 index 000000000000..002290ef1f4a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/rotateClusterCertificates.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * + * @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersRotateClusterCertificates.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function rotateClusterCertificates() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRotateClusterCertificatesAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +rotateClusterCertificates().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..d1e84753866b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsCreateOrUpdateSample.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { Snapshot, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Creates or updates a snapshot. + * + * @summary Creates or updates a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsCreate.json + */ +async function createOrUpdateSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: Snapshot = { + creationData: { + sourceResourceId: + "/subscriptions/subid1/resourcegroups/rg1/providers/Microsoft.ContainerService/managedClusters/cluster1/agentPools/pool0" + }, + location: "westus", + tags: { key1: "val1", key2: "val2" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.createOrUpdate( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +createOrUpdateSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..762f0dfd1057 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsDeleteSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Deletes a snapshot. + * + * @summary Deletes a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsDelete.json + */ +async function deleteSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.delete(resourceGroupName, resourceName); + console.log(result); +} + +deleteSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsGetSample.ts new file mode 100644 index 000000000000..82bff84c6c76 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsGetSample.ts @@ -0,0 +1,30 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a snapshot. + * + * @summary Gets a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsGet.json + */ +async function getSnapshot() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.get(resourceGroupName, resourceName); + console.log(result); +} + +getSnapshot().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..4fd50e410181 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListByResourceGroupSample.ts @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Lists snapshots in the specified subscription and resource group. + * + * @summary Lists snapshots in the specified subscription and resource group. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsListByResourceGroup.json + */ +async function listSnapshotsByResourceGroup() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.listByResourceGroup( + resourceGroupName + )) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshotsByResourceGroup().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListSample.ts new file mode 100644 index 000000000000..bcdf22f842d4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsListSample.ts @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Gets a list of snapshots in the specified subscription. + * + * @summary Gets a list of snapshots in the specified subscription. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsList.json + */ +async function listSnapshots() { + const subscriptionId = "subid1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const resArray = new Array(); + for await (let item of client.snapshots.list()) { + resArray.push(item); + } + console.log(resArray); +} + +listSnapshots().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsUpdateTagsSample.ts new file mode 100644 index 000000000000..0bbcad3d876b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/snapshotsUpdateTagsSample.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to Updates tags on a snapshot. + * + * @summary Updates tags on a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/examples/SnapshotsUpdateTags.json + */ +async function updateSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: TagsObject = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.updateTags( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startAgentPool.ts new file mode 100644 index 000000000000..da11fe149751 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startAgentPool.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Start.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function startAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { powerState: { code: "Running" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +startAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startManagedCluster.ts new file mode 100644 index 000000000000..c651026cee93 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/startManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * + * @summary See [starting a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about starting a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStart.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function startManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStartAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +startManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopAgentPool.ts new file mode 100644 index 000000000000..d097562b4b3d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopAgentPool.ts @@ -0,0 +1,37 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Stop.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function stopAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { powerState: { code: "Stopped" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +stopAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopManagedCluster.ts new file mode 100644 index 000000000000..ec7580095818 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/stopManagedCluster.ts @@ -0,0 +1,33 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * + * @summary This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A cluster does not accrue charges while it is stopped. See [stopping a cluster](https://docs.microsoft.com/azure/aks/start-stop-cluster) for more details about stopping a cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersStop.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function stopManagedCluster() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginStopAndWait( + resourceGroupName, + resourceName + ); + console.log(result); +} + +stopManagedCluster().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/submitNewCommand.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/submitNewCommand.ts new file mode 100644 index 000000000000..d491445abc39 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/submitNewCommand.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * + * @summary AKS will create a pod to run the command. This is primarily useful for private clusters. For more information see [AKS Run Command](https://docs.microsoft.com/azure/aks/private-clusters#aks-run-command-preview). + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/RunCommandRequest.json + */ +import { + RunCommandRequest, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function submitNewCommand() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const requestPayload: RunCommandRequest = { + clusterToken: "", + command: "kubectl apply -f ns.yaml", + context: "" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginRunCommandAndWait( + resourceGroupName, + resourceName, + requestPayload + ); + console.log(result); +} + +submitNewCommand().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateAgentPool.ts new file mode 100644 index 000000000000..35b855be63cd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateAgentPool.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Creates or updates an agent pool in the specified managed cluster. + * + * @summary Creates or updates an agent pool in the specified managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPools_Update.json + */ +import { AgentPool, ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateAgentPool() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const parameters: AgentPool = { + count: 3, + enableAutoScaling: true, + maxCount: 2, + minCount: 2, + nodeTaints: ["Key1=Value1:NoSchedule"], + orchestratorVersion: "", + osType: "Linux", + scaleSetEvictionPolicy: "Delete", + scaleSetPriority: "Spot", + vmSize: "Standard_DS1_v2" + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginCreateOrUpdateAndWait( + resourceGroupName, + resourceName, + agentPoolName, + parameters + ); + console.log(result); +} + +updateAgentPool().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateManagedClusterTags.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateManagedClusterTags.ts new file mode 100644 index 000000000000..710cc39e6dbc --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateManagedClusterTags.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags on a managed cluster. + * + * @summary Updates tags on a managed cluster. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/ManagedClustersUpdateTags.json + */ +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateManagedClusterTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const parameters: TagsObject = { tags: { archv3: "", tier: "testing" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.managedClusters.beginUpdateTagsAndWait( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateManagedClusterTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updatePrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updatePrivateEndpointConnection.ts new file mode 100644 index 000000000000..0d77112cd0ab --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updatePrivateEndpointConnection.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates a private endpoint connection. + * + * @summary Updates a private endpoint connection. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/PrivateEndpointConnectionsUpdate.json + */ +import { + PrivateEndpointConnection, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updatePrivateEndpointConnection() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const privateEndpointConnectionName = "privateendpointconnection1"; + const parameters: PrivateEndpointConnection = { + privateLinkServiceConnectionState: { status: "Approved" } + }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.update( + resourceGroupName, + resourceName, + privateEndpointConnectionName, + parameters + ); + console.log(result); +} + +updatePrivateEndpointConnection().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateSnapshotTags.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateSnapshotTags.ts new file mode 100644 index 000000000000..f98829e3ea01 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/updateSnapshotTags.ts @@ -0,0 +1,38 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Updates tags on a snapshot. + * + * @summary Updates tags on a snapshot. + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/SnapshotsUpdateTags.json + */ +import { + TagsObject, + ContainerServiceClient +} from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function updateSnapshotTags() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "snapshot1"; + const parameters: TagsObject = { tags: { key2: "new-val2", key3: "val3" } }; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.snapshots.updateTags( + resourceGroupName, + resourceName, + parameters + ); + console.log(result); +} + +updateSnapshotTags().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/upgradeAgentPoolNodeImageVersion.ts b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/upgradeAgentPoolNodeImageVersion.ts new file mode 100644 index 000000000000..e4b7d5d4e892 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/src/upgradeAgentPoolNodeImageVersion.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +/** + * This sample demonstrates how to Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * + * @summary Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-01-01/examples/AgentPoolsUpgradeNodeImageVersion.json + */ +import { ContainerServiceClient } from "@azure/arm-containerservice"; +import { DefaultAzureCredential } from "@azure/identity"; + +async function upgradeAgentPoolNodeImageVersion() { + const subscriptionId = "subid1"; + const resourceGroupName = "rg1"; + const resourceName = "clustername1"; + const agentPoolName = "agentpool1"; + const credential = new DefaultAzureCredential(); + const client = new ContainerServiceClient(credential, subscriptionId); + const result = await client.agentPools.beginUpgradeNodeImageVersionAndWait( + resourceGroupName, + resourceName, + agentPoolName + ); + console.log(result); +} + +upgradeAgentPoolNodeImageVersion().catch(console.error); diff --git a/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/tsconfig.json b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16-beta/typescript/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2018", + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "alwaysStrict": true, + "outDir": "dist", + "rootDir": "src" + }, + "include": [ + "src/**.ts" + ] +} diff --git a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts index 5388cad298c4..a7ac1f385fa8 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -17,7 +17,8 @@ import { PrivateEndpointConnectionsImpl, PrivateLinkResourcesImpl, ResolvePrivateLinkServiceIdImpl, - SnapshotsImpl + SnapshotsImpl, + ManagedClusterSnapshotsImpl } from "./operations"; import { Operations, @@ -27,7 +28,8 @@ import { PrivateEndpointConnections, PrivateLinkResources, ResolvePrivateLinkServiceId, - Snapshots + Snapshots, + ManagedClusterSnapshots } from "./operationsInterfaces"; import { ContainerServiceClientOptionalParams } from "./models"; @@ -63,7 +65,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-containerservice/16.0.1`; + const packageDetails = `azsdk-js-arm-containerservice/16.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -110,7 +112,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-03-01"; + this.apiVersion = options.apiVersion || "2022-03-02-preview"; this.operations = new OperationsImpl(this); this.managedClusters = new ManagedClustersImpl(this); this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this); @@ -121,6 +123,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { this ); this.snapshots = new SnapshotsImpl(this); + this.managedClusterSnapshots = new ManagedClusterSnapshotsImpl(this); } operations: Operations; @@ -131,4 +134,5 @@ export class ContainerServiceClient extends coreClient.ServiceClient { privateLinkResources: PrivateLinkResources; resolvePrivateLinkServiceId: ResolvePrivateLinkServiceId; snapshots: Snapshots; + managedClusterSnapshots: ManagedClusterSnapshots; } diff --git a/sdk/containerservice/arm-containerservice/src/models/index.ts b/sdk/containerservice/arm-containerservice/src/models/index.ts index f0eed7e2ce5c..2fefc02d087e 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -164,6 +164,12 @@ export interface PowerState { code?: Code; } +/** Data used when creating a target resource from a source resource. */ +export interface CreationData { + /** This is the ARM ID of the source object to be used to create the target object. */ + sourceResourceId?: string; +} + /** Properties for the container service agent pool profile. */ export interface ManagedClusterAgentPoolProfileProperties { /** Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1. */ @@ -178,6 +184,8 @@ export interface ManagedClusterAgentPoolProfileProperties { kubeletDiskType?: KubeletDiskType; /** Determines the type of workload a node can run. */ workloadRuntime?: WorkloadRuntime; + /** A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). */ + messageOfTheDay?: string; /** If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ vnetSubnetID?: string; /** If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ @@ -200,8 +208,10 @@ export interface ManagedClusterAgentPoolProfileProperties { type?: AgentPoolType; /** A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools */ mode?: AgentPoolMode; - /** As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ + /** Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ orchestratorVersion?: string; + /** If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was , this field will contain the full version being used. */ + currentOrchestratorVersion?: string; /** * The version of node image * NOTE: This property will not be serialized. It can only be populated by the server. @@ -250,6 +260,10 @@ export interface ManagedClusterAgentPoolProfileProperties { gpuInstanceProfile?: GPUInstanceProfile; /** CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. */ creationData?: CreationData; + /** AKS will associate the specified agent pool with the Capacity Reservation Group. */ + capacityReservationGroupID?: string; + /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). */ + hostGroupID?: string; } /** Settings for upgrading an agentpool */ @@ -356,12 +370,6 @@ export interface SysctlConfig { vmVfsCachePressure?: number; } -/** Data used when creating a target resource from a source resource. */ -export interface CreationData { - /** This is the ARM ID of the source object to be used to create the target object. */ - sourceResourceId?: string; -} - /** Profile for Linux VMs in the container service cluster. */ export interface ContainerServiceLinuxProfile { /** The administrator username to use for Linux VMs. */ @@ -501,6 +509,17 @@ export interface ManagedClusterPodIdentityException { podLabels: { [propertyName: string]: string }; } +/** The OIDC issuer profile of the Managed Cluster. */ +export interface ManagedClusterOidcIssuerProfile { + /** + * The OIDC issuer url of the Managed Cluster. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly issuerURL?: string; + /** Whether the OIDC issuer is enabled. */ + enabled?: boolean; +} + /** Profile of network configuration. */ export interface ContainerServiceNetworkProfile { /** Network plugin used for building the Kubernetes network. */ @@ -696,6 +715,11 @@ export interface ManagedClusterHttpProxyConfig { httpsProxy?: string; /** The endpoints that should not go through proxy. */ noProxy?: string[]; + /** + * A read-only list of all endpoints for which traffic should not be sent to the proxy. This list is a superset of noProxy and values injected by AKS. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly effectiveNoProxy?: string[]; /** Alternative CA cert to use for connecting to proxy servers. */ trustedCa?: string; } @@ -704,6 +728,10 @@ export interface ManagedClusterHttpProxyConfig { export interface ManagedClusterSecurityProfile { /** Azure Defender settings for the security profile. */ azureDefender?: ManagedClusterSecurityProfileAzureDefender; + /** Azure Key Vault [key management service](https://kubernetes.io/docs/tasks/administer-cluster/kms-provider/) settings for the security profile. */ + azureKeyVaultKms?: AzureKeyVaultKms; + /** [Workload Identity](https://azure.github.io/azure-workload-identity/docs/) settings for the security profile. */ + workloadIdentity?: ManagedClusterSecurityProfileWorkloadIdentity; } /** Azure Defender settings for the security profile. */ @@ -714,6 +742,34 @@ export interface ManagedClusterSecurityProfileAzureDefender { logAnalyticsWorkspaceResourceId?: string; } +/** Azure Key Vault key management service settings for the security profile. */ +export interface AzureKeyVaultKms { + /** Whether to enable Azure Key Vault key management service. The default is false. */ + enabled?: boolean; + /** Identifier of Azure Key Vault key. See [key identifier format](https://docs.microsoft.com/en-us/azure/key-vault/general/about-keys-secrets-certificates#vault-name-and-object-name) for more details. When Azure Key Vault key management service is enabled, this field is required and must be a valid key identifier. When Azure Key Vault key management service is disabled, leave the field empty. */ + keyId?: string; +} + +/** Workload Identity settings for the security profile. */ +export interface ManagedClusterSecurityProfileWorkloadIdentity { + /** Whether to enable Workload Identity */ + enabled?: boolean; +} + +/** Ingress profile for the container service cluster. */ +export interface ManagedClusterIngressProfile { + /** Web App Routing settings for the ingress profile. */ + webAppRouting?: ManagedClusterIngressProfileWebAppRouting; +} + +/** Web App Routing settings for the ingress profile. */ +export interface ManagedClusterIngressProfileWebAppRouting { + /** Whether to enable Web App Routing. */ + enabled?: boolean; + /** Resource ID of the DNS Zone to be associated with the web app. Used only when Web App Routing is enabled. */ + dnsZoneResourceId?: string; +} + /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -1099,6 +1155,44 @@ export interface SnapshotListResult { readonly nextLink?: string; } +/** The response from the List Managed Cluster Snapshots operation. */ +export interface ManagedClusterSnapshotListResult { + /** The list of managed cluster snapshots. */ + value?: ManagedClusterSnapshot[]; + /** + * The URL to get the next set of managed cluster snapshot results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** managed cluster properties for snapshot, these properties are read only. */ +export interface ManagedClusterPropertiesForSnapshot { + /** The current kubernetes version. */ + kubernetesVersion?: string; + /** The current managed cluster sku. */ + sku?: ManagedClusterSKU; + /** Whether the cluster has enabled Kubernetes Role-Based Access Control or not. */ + enableRbac?: boolean; + /** + * The current network profile. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly networkProfile?: NetworkProfileForSnapshot; +} + +/** network profile for managed cluster snapshot, these properties are read only. */ +export interface NetworkProfileForSnapshot { + /** networkPlugin for managed cluster snapshot. */ + networkPlugin?: NetworkPlugin; + /** networkPolicy for managed cluster snapshot. */ + networkPolicy?: NetworkPolicy; + /** networkMode for managed cluster snapshot. */ + networkMode?: NetworkMode; + /** loadBalancerSku for managed cluster snapshot. */ + loadBalancerSku?: LoadBalancerSku; +} + /** Profile for the container service master. */ export interface ContainerServiceMasterProfile { /** Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. */ @@ -1153,6 +1247,8 @@ export interface ManagedClusterStorageProfile { export interface ManagedClusterStorageProfileDiskCSIDriver { /** Whether to enable AzureDisk CSI Driver. The default value is true. */ enabled?: boolean; + /** The version of AzureDisk CSI Driver. The default value is v1. */ + version?: string; } /** AzureFile CSI Driver settings for the storage profile. */ @@ -1211,6 +1307,8 @@ export type AgentPool = SubResource & { kubeletDiskType?: KubeletDiskType; /** Determines the type of workload a node can run. */ workloadRuntime?: WorkloadRuntime; + /** A base64-encoded string which will be written to /etc/motd after decoding. This allows customization of the message of the day for Linux nodes. It must not be specified for Windows nodes. It must be a static string (i.e., will be printed raw and not be executed as a script). */ + messageOfTheDay?: string; /** If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ vnetSubnetID?: string; /** If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName} */ @@ -1233,8 +1331,10 @@ export type AgentPool = SubResource & { typePropertiesType?: AgentPoolType; /** A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools */ mode?: AgentPoolMode; - /** As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ + /** Both patch version and are supported. When is specified, the latest supported patch version is chosen automatically. Updating the agent pool with the same once it has been created will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool). */ orchestratorVersion?: string; + /** If orchestratorVersion was a fully specified version , this field will be exactly equal to it. If orchestratorVersion was , this field will contain the full version being used. */ + currentOrchestratorVersion?: string; /** * The version of node image * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1283,6 +1383,10 @@ export type AgentPool = SubResource & { gpuInstanceProfile?: GPUInstanceProfile; /** CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot. */ creationData?: CreationData; + /** AKS will associate the specified agent pool with the Capacity Reservation Group. */ + capacityReservationGroupID?: string; + /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts). */ + hostGroupID?: string; }; /** Managed cluster. */ @@ -1303,6 +1407,8 @@ export type ManagedCluster = TrackedResource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly powerState?: PowerState; + /** CreationData to be used to specify the source Snapshot ID if the cluster will be created/upgraded using a snapshot. */ + creationData?: CreationData; /** * The max number of agent pools for the managed cluster. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1310,6 +1416,11 @@ export type ManagedCluster = TrackedResource & { readonly maxAgentPools?: number; /** When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details. */ kubernetesVersion?: string; + /** + * The version of Kubernetes the Managed Cluster is running. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly currentKubernetesVersion?: string; /** This cannot be updated once the Managed Cluster has been created. */ dnsPrefix?: string; /** This cannot be updated once the Managed Cluster has been created. */ @@ -1341,12 +1452,16 @@ export type ManagedCluster = TrackedResource & { addonProfiles?: { [propertyName: string]: ManagedClusterAddonProfile }; /** See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration. */ podIdentityProfile?: ManagedClusterPodIdentityProfile; + /** The OIDC issuer profile of the Managed Cluster. */ + oidcIssuerProfile?: ManagedClusterOidcIssuerProfile; /** The name of the resource group containing agent pool nodes. */ nodeResourceGroup?: string; /** Whether to enable Kubernetes Role-Based Access Control. */ enableRbac?: boolean; /** (DEPRECATING) Whether to enable Kubernetes pod security policy (preview). This feature is set for removal on October 15th, 2020. Learn more at aka.ms/aks/azpodpolicy. */ enablePodSecurityPolicy?: boolean; + /** The default value is false. It can be enabled/disabled on creation and updation of the managed cluster. See [https://aka.ms/NamespaceARMResource](https://aka.ms/NamespaceARMResource) for more details on Namespace as a ARM Resource. */ + enableNamespaceResources?: boolean; /** The network configuration profile. */ networkProfile?: ContainerServiceNetworkProfile; /** The Azure Active Directory configuration. */ @@ -1369,6 +1484,8 @@ export type ManagedCluster = TrackedResource & { httpProxyConfig?: ManagedClusterHttpProxyConfig; /** Security profile for the managed cluster. */ securityProfile?: ManagedClusterSecurityProfile; + /** Ingress profile for the managed cluster. */ + ingressProfile?: ManagedClusterIngressProfile; /** Allow or deny public network access for AKS */ publicNetworkAccess?: PublicNetworkAccess; }; @@ -1417,6 +1534,19 @@ export type Snapshot = TrackedResource & { readonly enableFips?: boolean; }; +/** A managed cluster snapshot resource. */ +export type ManagedClusterSnapshot = TrackedResource & { + /** CreationData to be used to specify the source resource ID to create this snapshot. */ + creationData?: CreationData; + /** The type of a snapshot. The default is NodePool. */ + snapshotType?: SnapshotType; + /** + * What the properties will be showed when getting managed cluster snapshot. Those properties are read-only. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly managedClusterPropertiesReadOnly?: ManagedClusterPropertiesForSnapshot; +}; + /** Defines headers for AgentPools_upgradeNodeImageVersion operation. */ export interface AgentPoolsUpgradeNodeImageVersionHeaders { /** URL to query for status of the operation. */ @@ -1730,7 +1860,9 @@ export enum KnownNetworkPlugin { /** Use the Azure CNI network plugin. See [Azure CNI (advanced) networking](https://docs.microsoft.com/azure/aks/concepts-network#azure-cni-advanced-networking) for more information. */ Azure = "azure", /** Use the Kubenet network plugin. See [Kubenet (basic) networking](https://docs.microsoft.com/azure/aks/concepts-network#kubenet-basic-networking) for more information. */ - Kubenet = "kubenet" + Kubenet = "kubenet", + /** Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking functionality. */ + None = "none" } /** @@ -1739,7 +1871,8 @@ export enum KnownNetworkPlugin { * this enum contains the known values that the service supports. * ### Known values supported by the service * **azure**: Use the Azure CNI network plugin. See [Azure CNI (advanced) networking](https:\/\/docs.microsoft.com\/azure\/aks\/concepts-network#azure-cni-advanced-networking) for more information. \ - * **kubenet**: Use the Kubenet network plugin. See [Kubenet (basic) networking](https:\/\/docs.microsoft.com\/azure\/aks\/concepts-network#kubenet-basic-networking) for more information. + * **kubenet**: Use the Kubenet network plugin. See [Kubenet (basic) networking](https:\/\/docs.microsoft.com\/azure\/aks\/concepts-network#kubenet-basic-networking) for more information. \ + * **none**: Do not use a network plugin. A custom CNI will need to be installed after cluster creation for networking functionality. */ export type NetworkPlugin = string; @@ -2011,7 +2144,9 @@ export type ConnectionStatus = string; /** Known values of {@link SnapshotType} that the service accepts. */ export enum KnownSnapshotType { /** The snapshot is a snapshot of a node pool. */ - NodePool = "NodePool" + NodePool = "NodePool", + /** The snapshot is a snapshot of a managed cluster. */ + ManagedCluster = "ManagedCluster" } /** @@ -2019,7 +2154,8 @@ export enum KnownSnapshotType { * {@link KnownSnapshotType} can be used interchangeably with SnapshotType, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NodePool**: The snapshot is a snapshot of a node pool. + * **NodePool**: The snapshot is a snapshot of a node pool. \ + * **ManagedCluster**: The snapshot is a snapshot of a managed cluster. */ export type SnapshotType = string; @@ -2514,6 +2650,8 @@ export type ManagedClustersUpdateTagsResponse = ManagedCluster; /** Optional parameters. */ export interface ManagedClustersDeleteOptionalParams extends coreClient.OperationOptions { + /** ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget */ + ignorePodDisruptionBudget?: boolean; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2547,6 +2685,15 @@ export interface ManagedClustersRotateClusterCertificatesOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface ManagedClustersRotateServiceAccountSigningKeysOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface ManagedClustersStopOptionalParams extends coreClient.OperationOptions { @@ -2673,6 +2820,8 @@ export type AgentPoolsCreateOrUpdateResponse = AgentPool; /** Optional parameters. */ export interface AgentPoolsDeleteOptionalParams extends coreClient.OperationOptions { + /** ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget */ + ignorePodDisruptionBudget?: boolean; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -2806,6 +2955,59 @@ export interface SnapshotsListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type SnapshotsListByResourceGroupNextResponse = SnapshotListResult; +/** Optional parameters. */ +export interface ManagedClusterSnapshotsListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type ManagedClusterSnapshotsListResponse = ManagedClusterSnapshotListResult; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsListByResourceGroupOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroup operation. */ +export type ManagedClusterSnapshotsListByResourceGroupResponse = ManagedClusterSnapshotListResult; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type ManagedClusterSnapshotsGetResponse = ManagedClusterSnapshot; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type ManagedClusterSnapshotsCreateOrUpdateResponse = ManagedClusterSnapshot; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsUpdateTagsOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the updateTags operation. */ +export type ManagedClusterSnapshotsUpdateTagsResponse = ManagedClusterSnapshot; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsListNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listNext operation. */ +export type ManagedClusterSnapshotsListNextResponse = ManagedClusterSnapshotListResult; + +/** Optional parameters. */ +export interface ManagedClusterSnapshotsListByResourceGroupNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByResourceGroupNext operation. */ +export type ManagedClusterSnapshotsListByResourceGroupNextResponse = ManagedClusterSnapshotListResult; + /** Optional parameters. */ export interface ContainerServiceClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index 9f41f45edf12..e25358b421cf 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -352,6 +352,21 @@ export const PowerState: coreClient.CompositeMapper = { } }; +export const CreationData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CreationData", + modelProperties: { + sourceResourceId: { + serializedName: "sourceResourceId", + type: { + name: "String" + } + } + } + } +}; + export const ManagedClusterAgentPoolProfileProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -397,6 +412,12 @@ export const ManagedClusterAgentPoolProfileProperties: coreClient.CompositeMappe name: "String" } }, + messageOfTheDay: { + serializedName: "messageOfTheDay", + type: { + name: "String" + } + }, vnetSubnetID: { serializedName: "vnetSubnetID", type: { @@ -470,6 +491,12 @@ export const ManagedClusterAgentPoolProfileProperties: coreClient.CompositeMappe name: "String" } }, + currentOrchestratorVersion: { + serializedName: "currentOrchestratorVersion", + type: { + name: "String" + } + }, nodeImageVersion: { serializedName: "nodeImageVersion", readOnly: true, @@ -617,6 +644,18 @@ export const ManagedClusterAgentPoolProfileProperties: coreClient.CompositeMappe name: "Composite", className: "CreationData" } + }, + capacityReservationGroupID: { + serializedName: "capacityReservationGroupID", + type: { + name: "String" + } + }, + hostGroupID: { + serializedName: "hostGroupID", + type: { + name: "String" + } } } } @@ -931,21 +970,6 @@ export const SysctlConfig: coreClient.CompositeMapper = { } }; -export const CreationData: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CreationData", - modelProperties: { - sourceResourceId: { - serializedName: "sourceResourceId", - type: { - name: "String" - } - } - } - } -}; - export const ContainerServiceLinuxProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1354,6 +1378,28 @@ export const ManagedClusterPodIdentityException: coreClient.CompositeMapper = { } }; +export const ManagedClusterOidcIssuerProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterOidcIssuerProfile", + modelProperties: { + issuerURL: { + serializedName: "issuerURL", + readOnly: true, + type: { + name: "String" + } + }, + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const ContainerServiceNetworkProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2012,6 +2058,18 @@ export const ManagedClusterHttpProxyConfig: coreClient.CompositeMapper = { } } }, + effectiveNoProxy: { + serializedName: "effectiveNoProxy", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, trustedCa: { serializedName: "trustedCa", type: { @@ -2033,6 +2091,20 @@ export const ManagedClusterSecurityProfile: coreClient.CompositeMapper = { name: "Composite", className: "ManagedClusterSecurityProfileAzureDefender" } + }, + azureKeyVaultKms: { + serializedName: "azureKeyVaultKms", + type: { + name: "Composite", + className: "AzureKeyVaultKms" + } + }, + workloadIdentity: { + serializedName: "workloadIdentity", + type: { + name: "Composite", + className: "ManagedClusterSecurityProfileWorkloadIdentity" + } } } } @@ -2059,6 +2131,79 @@ export const ManagedClusterSecurityProfileAzureDefender: coreClient.CompositeMap } }; +export const AzureKeyVaultKms: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AzureKeyVaultKms", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + keyId: { + serializedName: "keyId", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClusterSecurityProfileWorkloadIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterSecurityProfileWorkloadIdentity", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedClusterIngressProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterIngressProfile", + modelProperties: { + webAppRouting: { + serializedName: "webAppRouting", + type: { + name: "Composite", + className: "ManagedClusterIngressProfileWebAppRouting" + } + } + } + } +}; + +export const ManagedClusterIngressProfileWebAppRouting: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterIngressProfileWebAppRouting", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + }, + dnsZoneResourceId: { + serializedName: "dnsZoneResourceId", + type: { + name: "String" + } + } + } + } +}; + export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2965,6 +3110,103 @@ export const SnapshotListResult: coreClient.CompositeMapper = { } }; +export const ManagedClusterSnapshotListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterSnapshotListResult", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagedClusterSnapshot" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const ManagedClusterPropertiesForSnapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterPropertiesForSnapshot", + modelProperties: { + kubernetesVersion: { + serializedName: "kubernetesVersion", + type: { + name: "String" + } + }, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ManagedClusterSKU" + } + }, + enableRbac: { + serializedName: "enableRbac", + type: { + name: "Boolean" + } + }, + networkProfile: { + serializedName: "networkProfile", + type: { + name: "Composite", + className: "NetworkProfileForSnapshot" + } + } + } + } +}; + +export const NetworkProfileForSnapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NetworkProfileForSnapshot", + modelProperties: { + networkPlugin: { + defaultValue: "kubenet", + serializedName: "networkPlugin", + type: { + name: "String" + } + }, + networkPolicy: { + serializedName: "networkPolicy", + type: { + name: "String" + } + }, + networkMode: { + serializedName: "networkMode", + type: { + name: "String" + } + }, + loadBalancerSku: { + serializedName: "loadBalancerSku", + type: { + name: "String" + } + } + } + } +}; + export const ContainerServiceMasterProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3111,6 +3353,12 @@ export const ManagedClusterStorageProfileDiskCSIDriver: coreClient.CompositeMapp type: { name: "Boolean" } + }, + version: { + serializedName: "version", + type: { + name: "String" + } } } } @@ -3287,6 +3535,12 @@ export const AgentPool: coreClient.CompositeMapper = { name: "String" } }, + messageOfTheDay: { + serializedName: "properties.messageOfTheDay", + type: { + name: "String" + } + }, vnetSubnetID: { serializedName: "properties.vnetSubnetID", type: { @@ -3360,6 +3614,12 @@ export const AgentPool: coreClient.CompositeMapper = { name: "String" } }, + currentOrchestratorVersion: { + serializedName: "properties.currentOrchestratorVersion", + type: { + name: "String" + } + }, nodeImageVersion: { serializedName: "properties.nodeImageVersion", readOnly: true, @@ -3507,6 +3767,18 @@ export const AgentPool: coreClient.CompositeMapper = { name: "Composite", className: "CreationData" } + }, + capacityReservationGroupID: { + serializedName: "properties.capacityReservationGroupID", + type: { + name: "String" + } + }, + hostGroupID: { + serializedName: "properties.hostGroupID", + type: { + name: "String" + } } } } @@ -3553,6 +3825,13 @@ export const ManagedCluster: coreClient.CompositeMapper = { className: "PowerState" } }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData" + } + }, maxAgentPools: { serializedName: "properties.maxAgentPools", readOnly: true, @@ -3566,6 +3845,13 @@ export const ManagedCluster: coreClient.CompositeMapper = { name: "String" } }, + currentKubernetesVersion: { + serializedName: "properties.currentKubernetesVersion", + readOnly: true, + type: { + name: "String" + } + }, dnsPrefix: { serializedName: "properties.dnsPrefix", type: { @@ -3648,6 +3934,13 @@ export const ManagedCluster: coreClient.CompositeMapper = { className: "ManagedClusterPodIdentityProfile" } }, + oidcIssuerProfile: { + serializedName: "properties.oidcIssuerProfile", + type: { + name: "Composite", + className: "ManagedClusterOidcIssuerProfile" + } + }, nodeResourceGroup: { serializedName: "properties.nodeResourceGroup", type: { @@ -3666,6 +3959,12 @@ export const ManagedCluster: coreClient.CompositeMapper = { name: "Boolean" } }, + enableNamespaceResources: { + serializedName: "properties.enableNamespaceResources", + type: { + name: "Boolean" + } + }, networkProfile: { serializedName: "properties.networkProfile", type: { @@ -3748,6 +4047,13 @@ export const ManagedCluster: coreClient.CompositeMapper = { className: "ManagedClusterSecurityProfile" } }, + ingressProfile: { + serializedName: "properties.ingressProfile", + type: { + name: "Composite", + className: "ManagedClusterIngressProfile" + } + }, publicNetworkAccess: { serializedName: "properties.publicNetworkAccess", type: { @@ -3841,6 +4147,37 @@ export const Snapshot: coreClient.CompositeMapper = { } }; +export const ManagedClusterSnapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterSnapshot", + modelProperties: { + ...TrackedResource.type.modelProperties, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData" + } + }, + snapshotType: { + defaultValue: "NodePool", + serializedName: "properties.snapshotType", + type: { + name: "String" + } + }, + managedClusterPropertiesReadOnly: { + serializedName: "properties.managedClusterPropertiesReadOnly", + type: { + name: "Composite", + className: "ManagedClusterPropertiesForSnapshot" + } + } + } + } +}; + export const AgentPoolsUpgradeNodeImageVersionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/containerservice/arm-containerservice/src/models/parameters.ts b/sdk/containerservice/arm-containerservice/src/models/parameters.ts index e386a546621f..c83c37a48294 100644 --- a/sdk/containerservice/arm-containerservice/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservice/src/models/parameters.ts @@ -21,7 +21,8 @@ import { AgentPool as AgentPoolMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper, PrivateLinkResource as PrivateLinkResourceMapper, - Snapshot as SnapshotMapper + Snapshot as SnapshotMapper, + ManagedClusterSnapshot as ManagedClusterSnapshotMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -51,7 +52,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-03-01", + defaultValue: "2022-03-02-preview", isConstant: true, serializedName: "api-version", type: { @@ -184,6 +185,16 @@ export const parameters1: OperationParameter = { mapper: TagsObjectMapper }; +export const ignorePodDisruptionBudget: OperationQueryParameter = { + parameterPath: ["options", "ignorePodDisruptionBudget"], + mapper: { + serializedName: "ignore-pod-disruption-budget", + type: { + name: "Boolean" + } + } +}; + export const parameters2: OperationParameter = { parameterPath: "parameters", mapper: ManagedClusterServicePrincipalProfileMapper @@ -279,3 +290,8 @@ export const parameters8: OperationParameter = { parameterPath: "parameters", mapper: SnapshotMapper }; + +export const parameters9: OperationParameter = { + parameterPath: "parameters", + mapper: ManagedClusterSnapshotMapper +}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts index a369ccc10c2a..cef7bd8c5f6f 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/agentPools.ts @@ -567,7 +567,10 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.ignorePodDisruptionBudget + ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/containerservice/arm-containerservice/src/operations/index.ts b/sdk/containerservice/arm-containerservice/src/operations/index.ts index 6d786ed8c56d..67e60e725e9b 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/index.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/index.ts @@ -14,3 +14,4 @@ export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./resolvePrivateLinkServiceId"; export * from "./snapshots"; +export * from "./managedClusterSnapshots"; diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts new file mode 100644 index 000000000000..e6ac26542e18 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusterSnapshots.ts @@ -0,0 +1,447 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { ManagedClusterSnapshots } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerServiceClient } from "../containerServiceClient"; +import { + ManagedClusterSnapshot, + ManagedClusterSnapshotsListNextOptionalParams, + ManagedClusterSnapshotsListOptionalParams, + ManagedClusterSnapshotsListByResourceGroupNextOptionalParams, + ManagedClusterSnapshotsListByResourceGroupOptionalParams, + ManagedClusterSnapshotsListResponse, + ManagedClusterSnapshotsListByResourceGroupResponse, + ManagedClusterSnapshotsGetOptionalParams, + ManagedClusterSnapshotsGetResponse, + ManagedClusterSnapshotsCreateOrUpdateOptionalParams, + ManagedClusterSnapshotsCreateOrUpdateResponse, + TagsObject, + ManagedClusterSnapshotsUpdateTagsOptionalParams, + ManagedClusterSnapshotsUpdateTagsResponse, + ManagedClusterSnapshotsDeleteOptionalParams, + ManagedClusterSnapshotsListNextResponse, + ManagedClusterSnapshotsListByResourceGroupNextResponse +} from "../models"; + +/// +/** Class containing ManagedClusterSnapshots operations. */ +export class ManagedClusterSnapshotsImpl implements ManagedClusterSnapshots { + private readonly client: ContainerServiceClient; + + /** + * Initialize a new instance of the class ManagedClusterSnapshots class. + * @param client Reference to the service client + */ + constructor(client: ContainerServiceClient) { + this.client = client; + } + + /** + * Gets a list of managed cluster snapshots in the specified subscription. + * @param options The options parameters. + */ + public list( + options?: ManagedClusterSnapshotsListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listPagingPage(options); + } + }; + } + + private async *listPagingPage( + options?: ManagedClusterSnapshotsListOptionalParams + ): AsyncIterableIterator { + let result = await this._list(options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listNext(continuationToken, options); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listPagingAll( + options?: ManagedClusterSnapshotsListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(options)) { + yield* page; + } + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + public listByResourceGroup( + resourceGroupName: string, + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByResourceGroupPagingPage(resourceGroupName, options); + } + }; + } + + private async *listByResourceGroupPagingPage( + resourceGroupName: string, + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + let result = await this._listByResourceGroup(resourceGroupName, options); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByResourceGroupNext( + resourceGroupName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByResourceGroupPagingAll( + resourceGroupName: string, + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByResourceGroupPagingPage( + resourceGroupName, + options + )) { + yield* page; + } + } + + /** + * Gets a list of managed cluster snapshots in the specified subscription. + * @param options The options parameters. + */ + private _list( + options?: ManagedClusterSnapshotsListOptionalParams + ): Promise { + return this.client.sendOperationRequest({ options }, listOperationSpec); + } + + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + private _listByResourceGroup( + resourceGroupName: string, + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, options }, + listByResourceGroupOperationSpec + ); + } + + /** + * Gets a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ManagedClusterSnapshotsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster snapshot to create or update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + parameters: ManagedClusterSnapshot, + options?: ManagedClusterSnapshotsCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, parameters, options }, + createOrUpdateOperationSpec + ); + } + + /** + * Updates tags on a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster snapshot Tags operation. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + resourceName: string, + parameters: TagsObject, + options?: ManagedClusterSnapshotsUpdateTagsOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, parameters, options }, + updateTagsOperationSpec + ); + } + + /** + * Deletes a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: ManagedClusterSnapshotsDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + deleteOperationSpec + ); + } + + /** + * ListNext + * @param nextLink The nextLink from the previous successful call to the List method. + * @param options The options parameters. + */ + private _listNext( + nextLink: string, + options?: ManagedClusterSnapshotsListNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec + ); + } + + /** + * ListByResourceGroupNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. + * @param options The options parameters. + */ + private _listByResourceGroupNext( + resourceGroupName: string, + nextLink: string, + options?: ManagedClusterSnapshotsListByResourceGroupNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, nextLink, options }, + listByResourceGroupNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedclustersnapshots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshotListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshotListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshot + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshot + }, + 201: { + bodyMapper: Mappers.ManagedClusterSnapshot + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters9, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const updateTagsOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", + httpMethod: "PATCH", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshot + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.parameters1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclustersnapshots/{resourceName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshotListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ManagedClusterSnapshotListResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.nextLink + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts index fee316d8fce4..d5c53c65fd5b 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/managedClusters.ts @@ -50,6 +50,7 @@ import { ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, ManagedClustersRotateClusterCertificatesOptionalParams, + ManagedClustersRotateServiceAccountSigningKeysOptionalParams, ManagedClustersStopOptionalParams, ManagedClustersStartOptionalParams, RunCommandRequest, @@ -915,6 +916,88 @@ export class ManagedClustersImpl implements ManagedClusters { return poller.pollUntilDone(); } + /** + * Rotates the service account signing keys of a managed cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + async beginRotateServiceAccountSigningKeys( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams + ): Promise, void>> { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { resourceGroupName, resourceName, options }, + rotateServiceAccountSigningKeysOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Rotates the service account signing keys of a managed cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + async beginRotateServiceAccountSigningKeysAndWait( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams + ): Promise { + const poller = await this.beginRotateServiceAccountSigningKeys( + resourceGroupName, + resourceName, + options + ); + return poller.pollUntilDone(); + } + /** * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster * stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A @@ -1554,7 +1637,10 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], + queryParameters: [ + Parameters.apiVersion, + Parameters.ignorePodDisruptionBudget + ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1637,6 +1723,29 @@ const rotateClusterCertificatesOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const rotateServiceAccountSigningKeysOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateServiceAccountSigningKeys", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; const stopOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/stop", diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts index 6d786ed8c56d..67e60e725e9b 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts @@ -14,3 +14,4 @@ export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; export * from "./resolvePrivateLinkServiceId"; export * from "./snapshots"; +export * from "./managedClusterSnapshots"; diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusterSnapshots.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusterSnapshots.ts new file mode 100644 index 000000000000..bec60709a6e4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusterSnapshots.ts @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + ManagedClusterSnapshot, + ManagedClusterSnapshotsListOptionalParams, + ManagedClusterSnapshotsListByResourceGroupOptionalParams, + ManagedClusterSnapshotsGetOptionalParams, + ManagedClusterSnapshotsGetResponse, + ManagedClusterSnapshotsCreateOrUpdateOptionalParams, + ManagedClusterSnapshotsCreateOrUpdateResponse, + TagsObject, + ManagedClusterSnapshotsUpdateTagsOptionalParams, + ManagedClusterSnapshotsUpdateTagsResponse, + ManagedClusterSnapshotsDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a ManagedClusterSnapshots. */ +export interface ManagedClusterSnapshots { + /** + * Gets a list of managed cluster snapshots in the specified subscription. + * @param options The options parameters. + */ + list( + options?: ManagedClusterSnapshotsListOptionalParams + ): PagedAsyncIterableIterator; + /** + * Lists managed cluster snapshots in the specified subscription and resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param options The options parameters. + */ + listByResourceGroup( + resourceGroupName: string, + options?: ManagedClusterSnapshotsListByResourceGroupOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + resourceName: string, + options?: ManagedClusterSnapshotsGetOptionalParams + ): Promise; + /** + * Creates or updates a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters The managed cluster snapshot to create or update. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + resourceName: string, + parameters: ManagedClusterSnapshot, + options?: ManagedClusterSnapshotsCreateOrUpdateOptionalParams + ): Promise; + /** + * Updates tags on a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param parameters Parameters supplied to the Update managed cluster snapshot Tags operation. + * @param options The options parameters. + */ + updateTags( + resourceGroupName: string, + resourceName: string, + parameters: TagsObject, + options?: ManagedClusterSnapshotsUpdateTagsOptionalParams + ): Promise; + /** + * Deletes a managed cluster snapshot. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + resourceName: string, + options?: ManagedClusterSnapshotsDeleteOptionalParams + ): Promise; +} diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts index ff803ac9e121..5d7cb831a154 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/managedClusters.ts @@ -39,6 +39,7 @@ import { ManagedClusterAADProfile, ManagedClustersResetAADProfileOptionalParams, ManagedClustersRotateClusterCertificatesOptionalParams, + ManagedClustersRotateServiceAccountSigningKeysOptionalParams, ManagedClustersStopOptionalParams, ManagedClustersStartOptionalParams, RunCommandRequest, @@ -320,6 +321,28 @@ export interface ManagedClusters { resourceName: string, options?: ManagedClustersRotateClusterCertificatesOptionalParams ): Promise; + /** + * Rotates the service account signing keys of a managed cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + beginRotateServiceAccountSigningKeys( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams + ): Promise, void>>; + /** + * Rotates the service account signing keys of a managed cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + beginRotateServiceAccountSigningKeysAndWait( + resourceGroupName: string, + resourceName: string, + options?: ManagedClustersRotateServiceAccountSigningKeysOptionalParams + ): Promise; /** * This can only be performed on Azure Virtual Machine Scale set backed clusters. Stopping a cluster * stops the control plane and agent nodes entirely, while maintaining all object and cluster state. A