From 1f12acd24516a911e3dc569e21b23fd5adcd9a33 Mon Sep 17 00:00:00 2001 From: colawwj <70128817+colawwj@users.noreply.github.com> Date: Thu, 28 Apr 2022 14:23:21 +0800 Subject: [PATCH] containerservice-release (#21504) --- .../arm-containerservice/CHANGELOG.md | 32 +- .../arm-containerservice/_meta.json | 8 +- .../arm-containerservice/package.json | 8 +- .../review/arm-containerservice.api.md | 40 +- .../agentPoolsCreateOrUpdateSample.ts | 30 +- .../samples-dev/agentPoolsDeleteSample.ts | 2 +- ...oolsGetAvailableAgentPoolVersionsSample.ts | 2 +- .../samples-dev/agentPoolsGetSample.ts | 2 +- .../agentPoolsGetUpgradeProfileSample.ts | 2 +- .../samples-dev/agentPoolsListSample.ts | 2 +- ...agentPoolsUpgradeNodeImageVersionSample.ts | 2 +- ...nanceConfigurationsCreateOrUpdateSample.ts | 2 +- .../maintenanceConfigurationsDeleteSample.ts | 2 +- .../maintenanceConfigurationsGetSample.ts | 2 +- ...onfigurationsListByManagedClusterSample.ts | 2 +- .../managedClustersCreateOrUpdateSample.ts | 42 +- .../managedClustersDeleteSample.ts | 2 +- .../managedClustersGetAccessProfileSample.ts | 2 +- .../managedClustersGetCommandResultSample.ts | 4 +- .../managedClustersGetOSOptionsSample.ts | 2 +- .../samples-dev/managedClustersGetSample.ts | 2 +- .../managedClustersGetUpgradeProfileSample.ts | 2 +- ...anagedClustersListByResourceGroupSample.ts | 2 +- ...ustersListClusterAdminCredentialsSample.ts | 2 +- ...tClusterMonitoringUserCredentialsSample.ts | 2 +- ...lustersListClusterUserCredentialsSample.ts | 2 +- ...boundNetworkDependenciesEndpointsSample.ts | 2 +- .../samples-dev/managedClustersListSample.ts | 2 +- .../managedClustersResetAadProfileSample.ts | 2 +- ...stersResetServicePrincipalProfileSample.ts | 2 +- ...ClustersRotateClusterCertificatesSample.ts | 2 +- .../managedClustersRunCommandSample.ts | 2 +- .../samples-dev/managedClustersStartSample.ts | 2 +- .../samples-dev/managedClustersStopSample.ts | 2 +- .../managedClustersUpdateTagsSample.ts | 2 +- .../samples-dev/operationsListSample.ts | 2 +- .../privateEndpointConnectionsDeleteSample.ts | 2 +- .../privateEndpointConnectionsGetSample.ts | 2 +- .../privateEndpointConnectionsListSample.ts | 2 +- .../privateEndpointConnectionsUpdateSample.ts | 2 +- .../privateLinkResourcesListSample.ts | 2 +- .../resolvePrivateLinkServiceIdPostSample.ts | 2 +- .../snapshotsCreateOrUpdateSample.ts | 2 +- .../samples-dev/snapshotsDeleteSample.ts | 2 +- .../samples-dev/snapshotsGetSample.ts | 2 +- .../snapshotsListByResourceGroupSample.ts | 2 +- .../samples-dev/snapshotsListSample.ts | 2 +- .../samples-dev/snapshotsUpdateTagsSample.ts | 2 +- .../samples/v16/javascript/README.md | 286 ++++ .../agentPoolsCreateOrUpdateSample.js | 549 +++++++ .../v16/javascript/agentPoolsDeleteSample.js | 35 + ...oolsGetAvailableAgentPoolVersionsSample.js | 33 + .../v16/javascript/agentPoolsGetSample.js | 31 + .../agentPoolsGetUpgradeProfileSample.js | 35 + .../v16/javascript/agentPoolsListSample.js | 33 + ...agentPoolsUpgradeNodeImageVersionSample.js | 35 + .../v16/javascript/commandFailedResult.js | 35 + .../v16/javascript/commandSucceedResult.js | 35 + ...createAgentPoolUsingAnAgentPoolSnapshot.js | 47 + ...ateAgentPoolWithEncryptionAtHostEnabled.js | 43 + .../createAgentPoolWithEphemeralOSDisk.js | 44 + .../createAgentPoolWithFipsEnabledOS.js | 43 + .../javascript/createAgentPoolWithGpumig.js | 64 + ...eAgentPoolWithKrustletAndTheWasiRuntime.js | 45 + ...ntPoolWithKubeletConfigAndLinuxOSConfig.js | 63 + .../javascript/createAgentPoolWithOssku.js | 64 + .../v16/javascript/createAgentPoolWithPpg.js | 44 + .../createAgentPoolWithUltraSsdEnabled.js | 43 + ...eManagedClusterUsingAnAgentPoolSnapshot.js | 77 + ...rWithAksManagedNatGatewayAsOutboundType.js | 72 + ...nagedClusterWithEncryptionAtHostEnabled.js | 73 + .../createManagedClusterWithFipsEnabledOS.js | 73 + .../createManagedClusterWithGpumig.js | 79 + ...teManagedClusterWithHttpProxyConfigured.js | 78 + ...ateManagedClusterWithNodePublicIPPrefix.js | 74 + .../createManagedClusterWithOssku.js | 79 + ...ateManagedClusterWithPodIdentityEnabled.js | 73 + .../javascript/createManagedClusterWithPpg.js | 74 + ...ateManagedClusterWithRunCommandDisabled.js | 72 + ...gedClusterWithSecurityProfileConfigured.js | 68 + ...createManagedClusterWithUltraSsdEnabled.js | 73 + ...ithUserAssignedNatGatewayAsOutboundType.js | 71 + ...rivateClusterWithFqdnSubdomainSpecified.js | 76 + ...edPrivateClusterWithPublicFqdnSpecified.js | 75 + ...ateAadManagedClusterWithEnableAzureRbac.js | 74 + .../v16/javascript/createOrUpdateAgentPool.js | 48 + .../createOrUpdateMaintenanceConfiguration.js | 45 + .../createOrUpdateManagedCluster.js | 89 ++ ...teManagedClusterWithDualStackNetworking.js | 90 ++ ...ateOrUpdateManagedClusterWithEnableAhub.js | 81 + ...ateManagedClusterWithWindowsGMsaEnabled.js | 81 + .../v16/javascript/createOrUpdateSnapshot.js | 38 + .../v16/javascript/createSpotAgentPool.js | 47 + .../samples/v16/javascript/deleteAgentPool.js | 35 + .../deleteMaintenanceConfiguration.js | 35 + .../v16/javascript/deleteManagedCluster.js | 30 + .../deletePrivateEndpointConnection.js | 35 + .../samples/v16/javascript/deleteSnapshot.js | 30 + .../samples/v16/javascript/getAgentPool.js | 31 + .../getAvailableVersionsForAgentPool.js | 33 + .../getContainerServiceOSOptions.js | 29 + .../javascript/getMaintenanceConfiguration.js | 35 + .../v16/javascript/getManagedCluster.js | 30 + .../getManagedClustersByResourceGroup.js | 32 + .../getPrivateEndpointConnection.js | 35 + .../samples/v16/javascript/getSnapshot.js | 30 + .../getUpgradeProfileForAgentPool.js | 35 + .../getUpgradeProfileForManagedCluster.js | 30 + .../listAgentPoolsByManagedCluster.js | 33 + ...sForTheContainerServiceResourceProvider.js | 31 + ...intenanceConfigurationsByManagedCluster.js | 36 + .../v16/javascript/listManagedClusters.js | 31 + ...rkDependenciesEndpointsByManagedCluster.js | 36 + ...vateEndpointConnectionsByManagedCluster.js | 30 + ...istPrivateLinkResourcesByManagedCluster.js | 30 + .../samples/v16/javascript/listSnapshots.js | 31 + .../listSnapshotsByResourceGroup.js | 32 + ...nanceConfigurationsCreateOrUpdateSample.js | 45 + .../maintenanceConfigurationsDeleteSample.js | 35 + .../maintenanceConfigurationsGetSample.js | 35 + ...onfigurationsListByManagedClusterSample.js | 36 + .../managedClustersCreateOrUpdateSample.js | 1362 ++++++++++++++++ .../javascript/managedClustersDeleteSample.js | 30 + .../managedClustersGetAccessProfileSample.js | 35 + .../managedClustersGetCommandResultSample.js | 58 + .../managedClustersGetOSOptionsSample.js | 29 + .../javascript/managedClustersGetSample.js | 30 + .../managedClustersGetUpgradeProfileSample.js | 30 + ...anagedClustersListByResourceGroupSample.js | 32 + ...ustersListClusterAdminCredentialsSample.js | 33 + ...tClusterMonitoringUserCredentialsSample.js | 33 + ...lustersListClusterUserCredentialsSample.js | 33 + ...boundNetworkDependenciesEndpointsSample.js | 36 + .../javascript/managedClustersListSample.js | 31 + .../managedClustersResetAadProfileSample.js | 40 + ...stersResetServicePrincipalProfileSample.js | 38 + ...ClustersRotateClusterCertificatesSample.js | 33 + .../managedClustersRunCommandSample.js | 39 + .../javascript/managedClustersStartSample.js | 30 + .../javascript/managedClustersStopSample.js | 30 + .../managedClustersUpdateTagsSample.js | 35 + .../v16/javascript/operationsListSample.js | 31 + .../samples/v16/javascript/package.json | 32 + .../privateEndpointConnectionsDeleteSample.js | 35 + .../privateEndpointConnectionsGetSample.js | 35 + .../privateEndpointConnectionsListSample.js | 30 + .../privateEndpointConnectionsUpdateSample.js | 39 + .../privateLinkResourcesListSample.js | 30 + .../samples/v16/javascript/resetAadProfile.js | 40 + .../resetServicePrincipalProfile.js | 38 + .../resolvePrivateLinkServiceIdPostSample.js | 35 + ...hePrivateLinkServiceIdForManagedCluster.js | 35 + .../javascript/rotateClusterCertificates.js | 33 + .../samples/v16/javascript/sample.env | 4 + .../snapshotsCreateOrUpdateSample.js | 38 + .../v16/javascript/snapshotsDeleteSample.js | 30 + .../v16/javascript/snapshotsGetSample.js | 30 + .../snapshotsListByResourceGroupSample.js | 32 + .../v16/javascript/snapshotsListSample.js | 31 + .../javascript/snapshotsUpdateTagsSample.js | 31 + .../samples/v16/javascript/startAgentPool.js | 37 + .../v16/javascript/startManagedCluster.js | 30 + .../samples/v16/javascript/stopAgentPool.js | 37 + .../v16/javascript/stopManagedCluster.js | 30 + .../v16/javascript/submitNewCommand.js | 39 + .../samples/v16/javascript/updateAgentPool.js | 48 + .../javascript/updateManagedClusterTags.js | 35 + .../updatePrivateEndpointConnection.js | 39 + .../v16/javascript/updateSnapshotTags.js | 31 + .../upgradeAgentPoolNodeImageVersion.js | 35 + .../samples/v16/typescript/README.md | 299 ++++ .../samples/v16/typescript/package.json | 41 + .../samples/v16/typescript/sample.env | 4 + .../src/agentPoolsCreateOrUpdateSample.ts | 549 +++++++ .../typescript/src/agentPoolsDeleteSample.ts | 35 + ...oolsGetAvailableAgentPoolVersionsSample.ts | 33 + .../v16/typescript/src/agentPoolsGetSample.ts | 35 + .../src/agentPoolsGetUpgradeProfileSample.ts | 35 + .../typescript/src/agentPoolsListSample.ts | 36 + ...agentPoolsUpgradeNodeImageVersionSample.ts | 35 + .../v16/typescript/src/commandFailedResult.ts | 35 + .../typescript/src/commandSucceedResult.ts | 35 + ...createAgentPoolUsingAnAgentPoolSnapshot.ts | 47 + ...ateAgentPoolWithEncryptionAtHostEnabled.ts | 43 + .../src/createAgentPoolWithEphemeralOSDisk.ts | 44 + .../src/createAgentPoolWithFipsEnabledOS.ts | 43 + .../src/createAgentPoolWithGpumig.ts | 64 + ...eAgentPoolWithKrustletAndTheWasiRuntime.ts | 45 + ...ntPoolWithKubeletConfigAndLinuxOSConfig.ts | 63 + .../src/createAgentPoolWithOssku.ts | 64 + .../typescript/src/createAgentPoolWithPpg.ts | 44 + .../src/createAgentPoolWithUltraSsdEnabled.ts | 43 + ...eManagedClusterUsingAnAgentPoolSnapshot.ts | 80 + ...rWithAksManagedNatGatewayAsOutboundType.ts | 77 + ...nagedClusterWithEncryptionAtHostEnabled.ts | 76 + .../createManagedClusterWithFipsEnabledOS.ts | 76 + .../src/createManagedClusterWithGpumig.ts | 82 + ...teManagedClusterWithHttpProxyConfigured.ts | 81 + ...ateManagedClusterWithNodePublicIPPrefix.ts | 77 + .../src/createManagedClusterWithOssku.ts | 82 + ...ateManagedClusterWithPodIdentityEnabled.ts | 76 + .../src/createManagedClusterWithPpg.ts | 77 + ...ateManagedClusterWithRunCommandDisabled.ts | 75 + ...gedClusterWithSecurityProfileConfigured.ts | 71 + ...createManagedClusterWithUltraSsdEnabled.ts | 76 + ...ithUserAssignedNatGatewayAsOutboundType.ts | 76 + ...rivateClusterWithFqdnSubdomainSpecified.ts | 79 + ...edPrivateClusterWithPublicFqdnSpecified.ts | 78 + ...ateAadManagedClusterWithEnableAzureRbac.ts | 77 + .../typescript/src/createOrUpdateAgentPool.ts | 48 + .../createOrUpdateMaintenanceConfiguration.ts | 48 + .../src/createOrUpdateManagedCluster.ts | 91 ++ ...teManagedClusterWithDualStackNetworking.ts | 92 ++ ...ateOrUpdateManagedClusterWithEnableAhub.ts | 83 + ...ateManagedClusterWithWindowsGMsaEnabled.ts | 83 + .../typescript/src/createOrUpdateSnapshot.ts | 42 + .../v16/typescript/src/createSpotAgentPool.ts | 47 + .../v16/typescript/src/deleteAgentPool.ts | 35 + .../src/deleteMaintenanceConfiguration.ts | 35 + .../typescript/src/deleteManagedCluster.ts | 33 + .../src/deletePrivateEndpointConnection.ts | 35 + .../v16/typescript/src/deleteSnapshot.ts | 30 + .../v16/typescript/src/getAgentPool.ts | 35 + .../src/getAvailableVersionsForAgentPool.ts | 33 + .../src/getContainerServiceOSOptions.ts | 29 + .../src/getMaintenanceConfiguration.ts | 35 + .../v16/typescript/src/getManagedCluster.ts | 33 + .../src/getManagedClustersByResourceGroup.ts | 34 + .../src/getPrivateEndpointConnection.ts | 35 + .../samples/v16/typescript/src/getSnapshot.ts | 30 + .../src/getUpgradeProfileForAgentPool.ts | 35 + .../src/getUpgradeProfileForManagedCluster.ts | 33 + .../src/listAgentPoolsByManagedCluster.ts | 36 + ...sForTheContainerServiceResourceProvider.ts | 33 + ...intenanceConfigurationsByManagedCluster.ts | 36 + .../v16/typescript/src/listManagedClusters.ts | 31 + ...rkDependenciesEndpointsByManagedCluster.ts | 36 + ...vateEndpointConnectionsByManagedCluster.ts | 33 + ...istPrivateLinkResourcesByManagedCluster.ts | 33 + .../v16/typescript/src/listSnapshots.ts | 31 + .../src/listSnapshotsByResourceGroup.ts | 34 + ...nanceConfigurationsCreateOrUpdateSample.ts | 48 + .../maintenanceConfigurationsDeleteSample.ts | 35 + .../src/maintenanceConfigurationsGetSample.ts | 35 + ...onfigurationsListByManagedClusterSample.ts | 36 + .../managedClustersCreateOrUpdateSample.ts | 1365 +++++++++++++++++ .../src/managedClustersDeleteSample.ts | 33 + .../managedClustersGetAccessProfileSample.ts | 35 + .../managedClustersGetCommandResultSample.ts | 58 + .../src/managedClustersGetOSOptionsSample.ts | 29 + .../src/managedClustersGetSample.ts | 33 + .../managedClustersGetUpgradeProfileSample.ts | 33 + ...anagedClustersListByResourceGroupSample.ts | 34 + ...ustersListClusterAdminCredentialsSample.ts | 33 + ...tClusterMonitoringUserCredentialsSample.ts | 33 + ...lustersListClusterUserCredentialsSample.ts | 33 + ...boundNetworkDependenciesEndpointsSample.ts | 36 + .../src/managedClustersListSample.ts | 31 + .../managedClustersResetAadProfileSample.ts | 43 + ...stersResetServicePrincipalProfileSample.ts | 41 + ...ClustersRotateClusterCertificatesSample.ts | 33 + .../src/managedClustersRunCommandSample.ts | 42 + .../src/managedClustersStartSample.ts | 33 + .../src/managedClustersStopSample.ts | 33 + .../src/managedClustersUpdateTagsSample.ts | 38 + .../typescript/src/operationsListSample.ts | 33 + .../privateEndpointConnectionsDeleteSample.ts | 35 + .../privateEndpointConnectionsGetSample.ts | 35 + .../privateEndpointConnectionsListSample.ts | 33 + .../privateEndpointConnectionsUpdateSample.ts | 42 + .../src/privateLinkResourcesListSample.ts | 33 + .../v16/typescript/src/resetAadProfile.ts | 43 + .../src/resetServicePrincipalProfile.ts | 41 + .../resolvePrivateLinkServiceIdPostSample.ts | 38 + ...hePrivateLinkServiceIdForManagedCluster.ts | 38 + .../src/rotateClusterCertificates.ts | 33 + .../src/snapshotsCreateOrUpdateSample.ts | 42 + .../typescript/src/snapshotsDeleteSample.ts | 30 + .../v16/typescript/src/snapshotsGetSample.ts | 30 + .../src/snapshotsListByResourceGroupSample.ts | 34 + .../v16/typescript/src/snapshotsListSample.ts | 31 + .../src/snapshotsUpdateTagsSample.ts | 38 + .../v16/typescript/src/startAgentPool.ts | 37 + .../v16/typescript/src/startManagedCluster.ts | 33 + .../v16/typescript/src/stopAgentPool.ts | 37 + .../v16/typescript/src/stopManagedCluster.ts | 33 + .../v16/typescript/src/submitNewCommand.ts | 42 + .../v16/typescript/src/updateAgentPool.ts | 48 + .../src/updateManagedClusterTags.ts | 38 + .../src/updatePrivateEndpointConnection.ts | 42 + .../v16/typescript/src/updateSnapshotTags.ts | 38 + .../src/upgradeAgentPoolNodeImageVersion.ts | 35 + .../samples/v16/typescript/tsconfig.json | 17 + .../src/containerServiceClient.ts | 28 +- .../arm-containerservice/src/models/index.ts | 248 +-- .../src/models/mappers.ts | 821 +++++----- .../src/models/parameters.ts | 2 +- 297 files changed, 15599 insertions(+), 583 deletions(-) create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/README.md create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsCreateOrUpdateSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsDeleteSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetUpgradeProfileSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsUpgradeNodeImageVersionSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/commandFailedResult.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/commandSucceedResult.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEncryptionAtHostEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEphemeralOSDisk.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithFipsEnabledOS.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithGpumig.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithOssku.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithPpg.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithUltraSsdEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithEncryptionAtHostEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithFipsEnabledOS.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithGpumig.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithHttpProxyConfigured.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithNodePublicIPPrefix.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithOssku.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPodIdentityEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPpg.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithRunCommandDisabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithSecurityProfileConfigured.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUltraSsdEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateMaintenanceConfiguration.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithEnableAhub.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateSnapshot.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/createSpotAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteMaintenanceConfiguration.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/deletePrivateEndpointConnection.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteSnapshot.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getAvailableVersionsForAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getContainerServiceOSOptions.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getMaintenanceConfiguration.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedClustersByResourceGroup.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getPrivateEndpointConnection.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getSnapshot.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listAgentPoolsByManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listMaintenanceConfigurationsByManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listManagedClusters.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateEndpointConnectionsByManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateLinkResourcesByManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshots.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshotsByResourceGroup.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsCreateOrUpdateSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsDeleteSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsGetSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsListByManagedClusterSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersCreateOrUpdateSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersDeleteSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetAccessProfileSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetCommandResultSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetOSOptionsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetUpgradeProfileSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListByResourceGroupSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterAdminCredentialsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterUserCredentialsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetAadProfileSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetServicePrincipalProfileSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRotateClusterCertificatesSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRunCommandSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStartSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStopSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersUpdateTagsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/operationsListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/package.json create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsGetSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsUpdateSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/privateLinkResourcesListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/resetAadProfile.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/resetServicePrincipalProfile.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/resolvePrivateLinkServiceIdPostSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/rotateClusterCertificates.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/sample.env create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsCreateOrUpdateSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsDeleteSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsGetSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListByResourceGroupSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsUpdateTagsSample.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/startAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/startManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/stopAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/stopManagedCluster.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/submitNewCommand.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/updateAgentPool.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/updateManagedClusterTags.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/updatePrivateEndpointConnection.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/updateSnapshotTags.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/javascript/upgradeAgentPoolNodeImageVersion.js create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/README.md create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/package.json create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/sample.env create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsCreateOrUpdateSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsDeleteSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetUpgradeProfileSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandFailedResult.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandSucceedResult.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEphemeralOSDisk.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithFipsEnabledOS.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithGpumig.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithOssku.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithPpg.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithUltraSsdEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithFipsEnabledOS.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithGpumig.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithHttpProxyConfigured.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithOssku.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPodIdentityEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPpg.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithRunCommandDisabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUltraSsdEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateMaintenanceConfiguration.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateSnapshot.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createSpotAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteMaintenanceConfiguration.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deletePrivateEndpointConnection.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteSnapshot.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAvailableVersionsForAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getContainerServiceOSOptions.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getMaintenanceConfiguration.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedClustersByResourceGroup.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getPrivateEndpointConnection.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getSnapshot.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAgentPoolsByManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listManagedClusters.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateLinkResourcesByManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshots.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshotsByResourceGroup.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsDeleteSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsGetSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersCreateOrUpdateSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersDeleteSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetAccessProfileSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetCommandResultSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetOSOptionsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetUpgradeProfileSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListByResourceGroupSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterAdminCredentialsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterUserCredentialsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetAadProfileSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetServicePrincipalProfileSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRotateClusterCertificatesSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRunCommandSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStartSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStopSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersUpdateTagsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/operationsListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsUpdateSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateLinkResourcesListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetAadProfile.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetServicePrincipalProfile.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolvePrivateLinkServiceIdPostSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/rotateClusterCertificates.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsCreateOrUpdateSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsDeleteSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsGetSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListByResourceGroupSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsUpdateTagsSample.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopManagedCluster.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/submitNewCommand.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateAgentPool.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateManagedClusterTags.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updatePrivateEndpointConnection.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateSnapshotTags.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/src/upgradeAgentPoolNodeImageVersion.ts create mode 100644 sdk/containerservice/arm-containerservice/samples/v16/typescript/tsconfig.json diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index cd36f3b71591..d543801a4205 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,15 +1,27 @@ # Release History + +## 16.0.0 (2022-04-20) + +**Features** -## 15.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface ManagedClusterStorageProfile + - Added Interface ManagedClusterStorageProfileDiskCSIDriver + - Added Interface ManagedClusterStorageProfileFileCSIDriver + - Added Interface ManagedClusterStorageProfileSnapshotController + - Added Type Alias TrackedResource + - Add parameters of TrackedResource to TypeAlias ManagedCluster + - Add parameters of TrackedResource to TypeAlias ManagedClusterAccessProfile + - Add parameters of TrackedResource to TypeAlias Snapshot + +**Breaking Changes** + + - Interface Resource no longer has parameter location + - Interface Resource no longer has parameter tags + - Delete parameters of Resource in TypeAlias ManagedCluster + - Delete parameters of Resource in TypeAlias ManagedClusterAccessProfile + - Delete parameters of Resource in TypeAlias Snapshot + + ## 15.2.0 (2022-03-23) **Features** diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index 64d0053e6b13..ca61735baa58 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "82fdf284eea880a8e027c354911a814999a77178", + "commit": "8a9bd9c5b65e5c3e5a8536f3c5b2b15bf9920b5d", "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-beta.17 --generate-sample=true", + "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.0", - "use": "@autorest/typescript@6.0.0-beta.17" + "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", + "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 da195ebb08b8..d2ee71c045d6 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": "15.2.1", + "version": "16.0.0", "engines": { "node": ">=12.0.0" }, @@ -11,9 +11,9 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.0.0", + "@azure/core-client": "^1.5.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.1.0", + "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" }, "keywords": [ @@ -115,4 +115,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md index 1f56b830651c..33fe2d37b10b 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -1048,7 +1048,7 @@ export interface MaintenanceConfigurationsListByManagedClusterOptionalParams ext export type MaintenanceConfigurationsListByManagedClusterResponse = MaintenanceConfigurationListResult; // @public -export type ManagedCluster = Resource & { +export type ManagedCluster = TrackedResource & { sku?: ManagedClusterSKU; extendedLocation?: ExtendedLocation; identity?: ManagedClusterIdentity; @@ -1100,7 +1100,7 @@ export interface ManagedClusterAADProfile { } // @public -export type ManagedClusterAccessProfile = Resource & { +export type ManagedClusterAccessProfile = TrackedResource & { kubeConfig?: Uint8Array; }; @@ -1547,6 +1547,28 @@ export interface ManagedClustersStopOptionalParams extends coreClient.OperationO updateIntervalInMs?: number; } +// @public +export interface ManagedClusterStorageProfile { + diskCSIDriver?: ManagedClusterStorageProfileDiskCSIDriver; + fileCSIDriver?: ManagedClusterStorageProfileFileCSIDriver; + snapshotController?: ManagedClusterStorageProfileSnapshotController; +} + +// @public +export interface ManagedClusterStorageProfileDiskCSIDriver { + enabled?: boolean; +} + +// @public +export interface ManagedClusterStorageProfileFileCSIDriver { + enabled?: boolean; +} + +// @public +export interface ManagedClusterStorageProfileSnapshotController { + enabled?: boolean; +} + // @public export interface ManagedClustersUpdateTagsOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -1769,12 +1791,8 @@ export type ResolvePrivateLinkServiceIdPostResponse = PrivateLinkResource; // @public export interface Resource { readonly id?: string; - location: string; readonly name?: string; readonly systemData?: SystemData; - tags?: { - [propertyName: string]: string; - }; readonly type?: string; } @@ -1814,7 +1832,7 @@ export type ScaleSetEvictionPolicy = string; export type ScaleSetPriority = string; // @public -export type Snapshot = Resource & { +export type Snapshot = TrackedResource & { creationData?: CreationData; snapshotType?: SnapshotType; readonly kubernetesVersion?: string; @@ -1965,6 +1983,14 @@ export interface TimeSpan { start?: Date; } +// @public +export type TrackedResource = Resource & { + tags?: { + [propertyName: string]: string; + }; + location: string; +}; + // @public export type UpgradeChannel = string; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts index ac2eac4aac98..58fedd17f05d 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsCreateOrUpdateSample.ts @@ -15,7 +15,7 @@ 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-02-01/examples/AgentPoolsCreate_Snapshot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Snapshot.json */ async function createAgentPoolUsingAnAgentPoolSnapshot() { const subscriptionId = "subid1"; @@ -50,7 +50,7 @@ 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-02-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableEncryptionAtHost.json */ async function createAgentPoolWithEncryptionAtHostEnabled() { const subscriptionId = "subid1"; @@ -81,7 +81,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-02-01/examples/AgentPoolsCreate_Ephemeral.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Ephemeral.json */ async function createAgentPoolWithEphemeralOSDisk() { const subscriptionId = "subid1"; @@ -113,7 +113,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-02-01/examples/AgentPoolsCreate_EnableFIPS.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableFIPS.json */ async function createAgentPoolWithFipsEnabledOS() { const subscriptionId = "subid1"; @@ -144,7 +144,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-02-01/examples/AgentPoolsCreate_GPUMIG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_GPUMIG.json */ async function createAgentPoolWithGpumig() { const subscriptionId = "subid1"; @@ -196,7 +196,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-02-01/examples/AgentPoolsCreate_WasmWasi.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_WasmWasi.json */ async function createAgentPoolWithKrustletAndTheWasiRuntime() { const subscriptionId = "subid1"; @@ -229,7 +229,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-02-01/examples/AgentPoolsCreate_CustomNodeConfig.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_CustomNodeConfig.json */ async function createAgentPoolWithKubeletConfigAndLinuxOSConfig() { const subscriptionId = "subid1"; @@ -280,7 +280,7 @@ 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-02-01/examples/AgentPoolsCreate_OSSKU.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_OSSKU.json */ async function createAgentPoolWithOssku() { const subscriptionId = "subid1"; @@ -332,7 +332,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-02-01/examples/AgentPoolsCreate_PPG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_PPG.json */ async function createAgentPoolWithPpg() { const subscriptionId = "subid1"; @@ -364,7 +364,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-02-01/examples/AgentPoolsCreate_EnableUltraSSD.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_EnableUltraSSD.json */ async function createAgentPoolWithUltraSsdEnabled() { const subscriptionId = "subid1"; @@ -395,7 +395,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-02-01/examples/AgentPoolsCreate_Spot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Spot.json */ async function createSpotAgentPool() { const subscriptionId = "subid1"; @@ -430,7 +430,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-02-01/examples/AgentPoolsCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsCreate_Update.json */ async function createOrUpdateAgentPool() { const subscriptionId = "subid1"; @@ -466,7 +466,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-02-01/examples/AgentPools_Start.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPools_Start.json */ async function startAgentPool() { const subscriptionId = "subid1"; @@ -491,7 +491,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-02-01/examples/AgentPools_Stop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPools_Stop.json */ async function stopAgentPool() { const subscriptionId = "subid1"; @@ -516,7 +516,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-02-01/examples/AgentPools_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 975a3e5b7162..396a0b209b5d 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-02-01/examples/AgentPoolsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsDelete.json */ async function deleteAgentPool() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/agentPoolsGetAvailableAgentPoolVersionsSample.ts index c2dbee42cc20..115f5a5f34cb 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-02-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 93c4e0f0cca7..75f4c4a6d5ca 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-02-01/examples/AgentPoolsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 9a150d5ce73e..46262c70e617 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-02-01/examples/AgentPoolsGetUpgradeProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 67d7da881714..81098e5cd6bd 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-02-01/examples/AgentPoolsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 0184fd04916d..dc3ab15f3a11 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-02-01/examples/AgentPoolsUpgradeNodeImageVersion.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 13c10901e7d0..537f5add6c4f 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-02-01/examples/MaintenanceConfigurationsCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 c7289b92a1a6..c116255eeb32 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-02-01/examples/MaintenanceConfigurationsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 d81c9a4fe8cf..d91f9c861c22 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-02-01/examples/MaintenanceConfigurationsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 cc545e9686ad..b502675c22c0 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-02-01/examples/MaintenanceConfigurationsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/MaintenanceConfigurationsList.json */ async function listMaintenanceConfigurationsByManagedCluster() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts index aea291e2e61d..e8e6fd626b3f 100644 --- a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts +++ b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersCreateOrUpdateSample.ts @@ -18,7 +18,7 @@ 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-02-01/examples/ManagedClustersCreate_Snapshot.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Snapshot.json */ async function createManagedClusterUsingAnAgentPoolSnapshot() { const subscriptionId = "subid1"; @@ -83,7 +83,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-02-01/examples/ManagedClustersCreate_ManagedNATGateway.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_ManagedNATGateway.json */ async function createManagedClusterWithAksManagedNatGatewayAsOutboundType() { const subscriptionId = "subid1"; @@ -145,7 +145,7 @@ 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-02-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnableEncryptionAtHost.json */ async function createManagedClusterWithEncryptionAtHostEnabled() { const subscriptionId = "subid1"; @@ -206,7 +206,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-02-01/examples/ManagedClustersCreate_EnabledFIPS.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnabledFIPS.json */ async function createManagedClusterWithFipsEnabledOS() { const subscriptionId = "subid1"; @@ -267,7 +267,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-02-01/examples/ManagedClustersCreate_GPUMIG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_GPUMIG.json */ async function createManagedClusterWithGpumig() { const subscriptionId = "subid1"; @@ -334,7 +334,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-02-01/examples/ManagedClustersCreate_HTTPProxy.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_HTTPProxy.json */ async function createManagedClusterWithHttpProxyConfigured() { const subscriptionId = "subid1"; @@ -400,7 +400,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-02-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_NodePublicIPPrefix.json */ async function createManagedClusterWithNodePublicIPPrefix() { const subscriptionId = "subid1"; @@ -462,7 +462,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-02-01/examples/ManagedClustersCreate_OSSKU.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_OSSKU.json */ async function createManagedClusterWithOssku() { const subscriptionId = "subid1"; @@ -529,7 +529,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-02-01/examples/ManagedClustersCreate_PPG.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PPG.json */ async function createManagedClusterWithPpg() { const subscriptionId = "subid1"; @@ -591,7 +591,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-02-01/examples/ManagedClustersCreate_PodIdentity.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PodIdentity.json */ async function createManagedClusterWithPodIdentityEnabled() { const subscriptionId = "subid1"; @@ -652,7 +652,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-02-01/examples/ManagedClustersCreate_DisableRunCommand.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_DisableRunCommand.json */ async function createManagedClusterWithRunCommandDisabled() { const subscriptionId = "subid1"; @@ -712,7 +712,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-02-01/examples/ManagedClustersCreate_SecurityProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_SecurityProfile.json */ async function createManagedClusterWithSecurityProfileConfigured() { const subscriptionId = "subid1"; @@ -768,7 +768,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-02-01/examples/ManagedClustersCreate_EnableUltraSSD.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_EnableUltraSSD.json */ async function createManagedClusterWithUltraSsdEnabled() { const subscriptionId = "subid1"; @@ -829,7 +829,7 @@ 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-02-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UserAssignedNATGateway.json */ async function createManagedClusterWithUserAssignedNatGatewayAsOutboundType() { const subscriptionId = "subid1"; @@ -890,7 +890,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-02-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PrivateClusterPublicFQDN.json */ async function createManagedPrivateClusterWithPublicFqdnSpecified() { const subscriptionId = "subid1"; @@ -953,7 +953,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-02-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_PrivateClusterFQDNSubdomain.json */ async function createManagedPrivateClusterWithFqdnSubdomainSpecified() { const subscriptionId = "subid1"; @@ -1017,7 +1017,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-02-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWithEnableAzureRBAC.json */ async function createOrUpdateAadManagedClusterWithEnableAzureRbac() { const subscriptionId = "subid1"; @@ -1079,7 +1079,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-02-01/examples/ManagedClustersCreate_Update.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Update.json */ async function createOrUpdateManagedCluster() { const subscriptionId = "subid1"; @@ -1155,7 +1155,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-02-01/examples/ManagedClustersCreate_UpdateWithAHUB.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWithAHUB.json */ async function createOrUpdateManagedClusterWithEnableAhub() { const subscriptionId = "subid1"; @@ -1223,7 +1223,7 @@ 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-02-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_UpdateWindowsGmsa.json */ async function createOrUpdateManagedClusterWithWindowsGMsaEnabled() { const subscriptionId = "subid1"; @@ -1291,7 +1291,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-02-01/examples/ManagedClustersCreate_DualStackNetworking.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 724c99882dea..b51710aa586e 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-02-01/examples/ManagedClustersDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 f5c70729229a..0c1a617e9ab5 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-02-01/examples/ManagedClustersGetAccessProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 b8b4d4158a5b..0026f19b615b 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-02-01/examples/RunCommandResultFailed.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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-02-01/examples/RunCommandResultSucceed.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 a4070f6b7fdc..3b777c150258 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-02-01/examples/ContainerServiceGetOSOptions.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 55b9034a66e2..d8306bfe7565 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-02-01/examples/ManagedClustersGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 7e4c02149d86..3df430890cae 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-02-01/examples/ManagedClustersGetUpgradeProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 d3f8bd503882..915a40844662 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-02-01/examples/ManagedClustersListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 377354834190..f5bedc881559 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-02-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 d9bc41429f53..858c00c20cdf 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-02-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 c57d672c5dd7..a73280e33673 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-02-01/examples/ManagedClustersListClusterCredentialResult.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 1d18e019387a..5d0a98a64bb9 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-02-01/examples/OutboundNetworkDependenciesEndpointsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 f9d118831554..391c7504ca32 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-02-01/examples/ManagedClustersList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 c6b2f77ba20b..5d8ff496b76f 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-02-01/examples/ManagedClustersResetAADProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 3eeb91865722..9d25266e6f4c 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-02-01/examples/ManagedClustersResetServicePrincipalProfile.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 3984eba11c16..a2aa4e730e76 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-02-01/examples/ManagedClustersRotateClusterCertificates.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersRotateClusterCertificates.json */ async function rotateClusterCertificates() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts b/sdk/containerservice/arm-containerservice/samples-dev/managedClustersRunCommandSample.ts index 032677f198a7..4003085b7458 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-02-01/examples/RunCommandRequest.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 7eac7ee52ccc..603ec4bac8a9 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-02-01/examples/ManagedClustersStart.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 219d81295095..edd4387a2f6e 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-02-01/examples/ManagedClustersStop.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 0305b14642c2..4da15c175c31 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-02-01/examples/ManagedClustersUpdateTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 e0a64bd196e5..d6bbf405fb93 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-02-01/examples/Operation_List.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 0d9751d9297f..382657bf81ff 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-02-01/examples/PrivateEndpointConnectionsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 a425d21eb1ee..83ad56405d17 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-02-01/examples/PrivateEndpointConnectionsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 f81aae931bf8..0eadd58955fc 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-02-01/examples/PrivateEndpointConnectionsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 92d0d7082439..952bd66abaaa 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-02-01/examples/PrivateEndpointConnectionsUpdate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 91c2b2648d25..9b54caef58f8 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-02-01/examples/PrivateLinkResourcesList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 348bafdf5456..d22b82b02762 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-02-01/examples/ResolvePrivateLinkServiceId.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 668ebe5ec294..f7585ccb5d92 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-02-01/examples/SnapshotsCreate.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 988f04bd2497..e4f439808be9 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-02-01/examples/SnapshotsDelete.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 dfa8a1f71c9f..47074edc1596 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-02-01/examples/SnapshotsGet.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 d5d21916bc84..c99508f1d098 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-02-01/examples/SnapshotsListByResourceGroup.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 9b426cc6f0b0..8237cb7e4ee2 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-02-01/examples/SnapshotsList.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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 c863b1c3969a..53cccd577d4a 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-02-01/examples/SnapshotsUpdateTags.json + * x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsUpdateTags.json */ async function updateSnapshotTags() { const subscriptionId = "subid1"; diff --git a/sdk/containerservice/arm-containerservice/samples/v16/javascript/README.md b/sdk/containerservice/arm-containerservice/samples/v16/javascript/README.md new file mode 100644 index 000000000000..4f6789a55db6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/javascript/README.md @@ -0,0 +1,286 @@ +# client library samples for JavaScript + +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/stable/2022-03-01/examples/AgentPoolsCreate_Snapshot.json | +| [agentPoolsDeleteSample.js][agentpoolsdeletesample] | 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 | +| [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/stable/2022-03-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [agentPoolsGetSample.js][agentpoolsgetsample] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsGet.json | +| [agentPoolsGetUpgradeProfileSample.js][agentpoolsgetupgradeprofilesample] | 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 | +| [agentPoolsListSample.js][agentpoolslistsample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/MaintenanceConfigurationsCreate_Update.json | +| [maintenanceConfigurationsDeleteSample.js][maintenanceconfigurationsdeletesample] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/MaintenanceConfigurationsList.json | +| [managedClustersCreateOrUpdateSample.js][managedclusterscreateorupdatesample] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Snapshot.json | +| [managedClustersDeleteSample.js][managedclustersdeletesample] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/RunCommandResultFailed.json | +| [managedClustersGetOSOptionsSample.js][managedclustersgetosoptionssample] | 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 | +| [managedClustersGetSample.js][managedclustersgetsample] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersGet.json | +| [managedClustersGetUpgradeProfileSample.js][managedclustersgetupgradeprofilesample] | 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 | +| [managedClustersListByResourceGroupSample.js][managedclusterslistbyresourcegroupsample] | 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 | +| [managedClustersListClusterAdminCredentialsSample.js][managedclusterslistclusteradmincredentialssample] | 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 | +| [managedClustersListClusterMonitoringUserCredentialsSample.js][managedclusterslistclustermonitoringusercredentialssample] | 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 | +| [managedClustersListClusterUserCredentialsSample.js][managedclusterslistclusterusercredentialssample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersList.json | +| [managedClustersResetAadProfileSample.js][managedclustersresetaadprofilesample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersRotateClusterCertificates.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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersStop.json | +| [managedClustersUpdateTagsSample.js][managedclustersupdatetagssample] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersUpdateTags.json | +| [operationsListSample.js][operationslistsample] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/Operation_List.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionsUpdateSample.js][privateendpointconnectionsupdatesample] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/SnapshotsCreate.json | +| [snapshotsDeleteSample.js][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsDelete.json | +| [snapshotsGetSample.js][snapshotsgetsample] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/SnapshotsList.json | +| [snapshotsUpdateTagsSample.js][snapshotsupdatetagssample] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/javascript/agentPoolsCreateOrUpdateSample.js +[agentpoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsDeleteSample.js +[agentpoolsgetavailableagentpoolversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js +[agentpoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetSample.js +[agentpoolsgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetUpgradeProfileSample.js +[agentpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsListSample.js +[agentpoolsupgradenodeimageversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsUpgradeNodeImageVersionSample.js +[commandfailedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/commandFailedResult.js +[commandsucceedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/commandSucceedResult.js +[createagentpoolusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js +[createagentpoolwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEncryptionAtHostEnabled.js +[createagentpoolwithephemeralosdisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEphemeralOSDisk.js +[createagentpoolwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithFipsEnabledOS.js +[createagentpoolwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithGpumig.js +[createagentpoolwithkrustletandthewasiruntime]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js +[createagentpoolwithkubeletconfigandlinuxosconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js +[createagentpoolwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithOssku.js +[createagentpoolwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithPpg.js +[createagentpoolwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithUltraSsdEnabled.js +[createmanagedclusterusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js +[createmanagedclusterwithaksmanagednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js +[createmanagedclusterwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithEncryptionAtHostEnabled.js +[createmanagedclusterwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithFipsEnabledOS.js +[createmanagedclusterwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithGpumig.js +[createmanagedclusterwithhttpproxyconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithHttpProxyConfigured.js +[createmanagedclusterwithnodepublicipprefix]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithNodePublicIPPrefix.js +[createmanagedclusterwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithOssku.js +[createmanagedclusterwithpodidentityenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPodIdentityEnabled.js +[createmanagedclusterwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPpg.js +[createmanagedclusterwithruncommanddisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithRunCommandDisabled.js +[createmanagedclusterwithsecurityprofileconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithSecurityProfileConfigured.js +[createmanagedclusterwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUltraSsdEnabled.js +[createmanagedclusterwithuserassignednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js +[createmanagedprivateclusterwithfqdnsubdomainspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js +[createmanagedprivateclusterwithpublicfqdnspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js +[createorupdateaadmanagedclusterwithenableazurerbac]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js +[createorupdateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAgentPool.js +[createorupdatemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateMaintenanceConfiguration.js +[createorupdatemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedCluster.js +[createorupdatemanagedclusterwithdualstacknetworking]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js +[createorupdatemanagedclusterwithenableahub]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithEnableAhub.js +[createorupdatemanagedclusterwithwindowsgmsaenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js +[createorupdatesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateSnapshot.js +[createspotagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/createSpotAgentPool.js +[deleteagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteAgentPool.js +[deletemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteMaintenanceConfiguration.js +[deletemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteManagedCluster.js +[deleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/deletePrivateEndpointConnection.js +[deletesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteSnapshot.js +[getagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getAgentPool.js +[getavailableversionsforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getAvailableVersionsForAgentPool.js +[getcontainerserviceosoptions]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getContainerServiceOSOptions.js +[getmaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getMaintenanceConfiguration.js +[getmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedCluster.js +[getmanagedclustersbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedClustersByResourceGroup.js +[getprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getPrivateEndpointConnection.js +[getsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getSnapshot.js +[getupgradeprofileforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForAgentPool.js +[getupgradeprofileformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForManagedCluster.js +[listagentpoolsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listAgentPoolsByManagedCluster.js +[listavailableoperationsforthecontainerserviceresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js +[listmaintenanceconfigurationsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listMaintenanceConfigurationsByManagedCluster.js +[listmanagedclusters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listManagedClusters.js +[listoutboundnetworkdependenciesendpointsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js +[listprivateendpointconnectionsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateEndpointConnectionsByManagedCluster.js +[listprivatelinkresourcesbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateLinkResourcesByManagedCluster.js +[listsnapshots]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshots.js +[listsnapshotsbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshotsByResourceGroup.js +[maintenanceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsCreateOrUpdateSample.js +[maintenanceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsDeleteSample.js +[maintenanceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsGetSample.js +[maintenanceconfigurationslistbymanagedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsListByManagedClusterSample.js +[managedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersCreateOrUpdateSample.js +[managedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersDeleteSample.js +[managedclustersgetaccessprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetAccessProfileSample.js +[managedclustersgetcommandresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetCommandResultSample.js +[managedclustersgetosoptionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetOSOptionsSample.js +[managedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetSample.js +[managedclustersgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetUpgradeProfileSample.js +[managedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListByResourceGroupSample.js +[managedclusterslistclusteradmincredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterAdminCredentialsSample.js +[managedclusterslistclustermonitoringusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js +[managedclusterslistclusterusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterUserCredentialsSample.js +[managedclusterslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js +[managedclusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListSample.js +[managedclustersresetaadprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetAadProfileSample.js +[managedclustersresetserviceprincipalprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetServicePrincipalProfileSample.js +[managedclustersrotateclustercertificatessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRotateClusterCertificatesSample.js +[managedclustersruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRunCommandSample.js +[managedclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStartSample.js +[managedclustersstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStopSample.js +[managedclustersupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersUpdateTagsSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/operationsListSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsListSample.js +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsUpdateSample.js +[privatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateLinkResourcesListSample.js +[resetaadprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/resetAadProfile.js +[resetserviceprincipalprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/resetServicePrincipalProfile.js +[resolveprivatelinkserviceidpostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/resolvePrivateLinkServiceIdPostSample.js +[resolvetheprivatelinkserviceidformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js +[rotateclustercertificates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/rotateClusterCertificates.js +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsCreateOrUpdateSample.js +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsDeleteSample.js +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsGetSample.js +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListByResourceGroupSample.js +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListSample.js +[snapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsUpdateTagsSample.js +[startagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/startAgentPool.js +[startmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/startManagedCluster.js +[stopagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/stopAgentPool.js +[stopmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/stopManagedCluster.js +[submitnewcommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/submitNewCommand.js +[updateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateAgentPool.js +[updatemanagedclustertags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateManagedClusterTags.js +[updateprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/updatePrivateEndpointConnection.js +[updatesnapshottags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateSnapshotTags.js +[upgradeagentpoolnodeimageversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/agentPoolsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsCreateOrUpdateSample.js new file mode 100644 index 000000000000..446624084256 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsCreateOrUpdateSample.js @@ -0,0 +1,549 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/javascript/agentPoolsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsDeleteSample.js new file mode 100644 index 000000000000..424120d0457b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsDeleteSample.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 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 + */ +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/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetAvailableAgentPoolVersionsSample.js new file mode 100644 index 000000000000..b10870f34499 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/agentPoolsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetSample.js new file mode 100644 index 000000000000..2ef15b81443a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/agentPoolsGetUpgradeProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsGetUpgradeProfileSample.js new file mode 100644 index 000000000000..527a48a2fa52 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/agentPoolsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsListSample.js new file mode 100644 index 000000000000..9095d0434280 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/agentPoolsUpgradeNodeImageVersionSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/agentPoolsUpgradeNodeImageVersionSample.js new file mode 100644 index 000000000000..3dc4f58d065d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/commandFailedResult.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/commandFailedResult.js new file mode 100644 index 000000000000..73629ae3b1ef --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/commandSucceedResult.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/commandSucceedResult.js new file mode 100644 index 000000000000..5f0e49e89be4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolUsingAnAgentPoolSnapshot.js new file mode 100644 index 000000000000..87d3faad1f5a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithEncryptionAtHostEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEncryptionAtHostEnabled.js new file mode 100644 index 000000000000..62c86b7b4f0f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithEphemeralOSDisk.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithEphemeralOSDisk.js new file mode 100644 index 000000000000..d10a4df0ccf3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithFipsEnabledOS.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithFipsEnabledOS.js new file mode 100644 index 000000000000..c3762ee0cee1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithGpumig.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithGpumig.js new file mode 100644 index 000000000000..69465952ec47 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKrustletAndTheWasiRuntime.js new file mode 100644 index 000000000000..76b0c11652e3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithKubeletConfigAndLinuxOSConfig.js new file mode 100644 index 000000000000..db2846213f02 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithOssku.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithOssku.js new file mode 100644 index 000000000000..2f863fb82123 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithPpg.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithPpg.js new file mode 100644 index 000000000000..158ce4268b59 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createAgentPoolWithUltraSsdEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createAgentPoolWithUltraSsdEnabled.js new file mode 100644 index 000000000000..8229692ab5c2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterUsingAnAgentPoolSnapshot.js new file mode 100644 index 000000000000..2f214767ad31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithAksManagedNatGatewayAsOutboundType.js new file mode 100644 index 000000000000..8fee1589afc1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithEncryptionAtHostEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithEncryptionAtHostEnabled.js new file mode 100644 index 000000000000..84cf0d6fe071 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithFipsEnabledOS.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithFipsEnabledOS.js new file mode 100644 index 000000000000..33d248add827 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithGpumig.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithGpumig.js new file mode 100644 index 000000000000..c30f611d5ee6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithHttpProxyConfigured.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithHttpProxyConfigured.js new file mode 100644 index 000000000000..dee98cf6bad3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithNodePublicIPPrefix.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithNodePublicIPPrefix.js new file mode 100644 index 000000000000..e60d26b4ce57 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithOssku.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithOssku.js new file mode 100644 index 000000000000..e2436d1825a6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithPodIdentityEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPodIdentityEnabled.js new file mode 100644 index 000000000000..cd9317cc8def --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithPpg.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithPpg.js new file mode 100644 index 000000000000..2b93d9e4eff7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithRunCommandDisabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithRunCommandDisabled.js new file mode 100644 index 000000000000..9d8bb6b9029a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithSecurityProfileConfigured.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithSecurityProfileConfigured.js new file mode 100644 index 000000000000..915745a55dcf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithUltraSsdEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUltraSsdEnabled.js new file mode 100644 index 000000000000..db8c43cb0193 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.js new file mode 100644 index 000000000000..6a5a4eb6c895 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithFqdnSubdomainSpecified.js new file mode 100644 index 000000000000..04a6c745e775 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createManagedPrivateClusterWithPublicFqdnSpecified.js new file mode 100644 index 000000000000..b86f085e81c7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAadManagedClusterWithEnableAzureRbac.js new file mode 100644 index 000000000000..261231b58887 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateAgentPool.js new file mode 100644 index 000000000000..363b1f032713 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateMaintenanceConfiguration.js new file mode 100644 index 000000000000..40869e8fd926 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedCluster.js new file mode 100644 index 000000000000..a6f726ff95e4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithDualStackNetworking.js new file mode 100644 index 000000000000..305dbe59c98b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateManagedClusterWithEnableAhub.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithEnableAhub.js new file mode 100644 index 000000000000..319cfb8ad065 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateManagedClusterWithWindowsGMsaEnabled.js new file mode 100644 index 000000000000..aa8e7209b1ec --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createOrUpdateSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createOrUpdateSnapshot.js new file mode 100644 index 000000000000..950cf4929188 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/createSpotAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/createSpotAgentPool.js new file mode 100644 index 000000000000..484cf75f6fa6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/deleteAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteAgentPool.js new file mode 100644 index 000000000000..1be7ff9fb4ac --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/deleteMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteMaintenanceConfiguration.js new file mode 100644 index 000000000000..7808ad14dc6e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/deleteManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteManagedCluster.js new file mode 100644 index 000000000000..4bc6c2cefc5c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/deletePrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/deletePrivateEndpointConnection.js new file mode 100644 index 000000000000..195570ba5a3b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/deleteSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/deleteSnapshot.js new file mode 100644 index 000000000000..1c9cf3f681b3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getAgentPool.js new file mode 100644 index 000000000000..e7e37bfe2426 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getAvailableVersionsForAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getAvailableVersionsForAgentPool.js new file mode 100644 index 000000000000..9820804ab6f2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getContainerServiceOSOptions.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getContainerServiceOSOptions.js new file mode 100644 index 000000000000..0ad1bda643c0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getMaintenanceConfiguration.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getMaintenanceConfiguration.js new file mode 100644 index 000000000000..e5259f26615d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedCluster.js new file mode 100644 index 000000000000..bb58d0367806 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getManagedClustersByResourceGroup.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getManagedClustersByResourceGroup.js new file mode 100644 index 000000000000..0f093f125b26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getPrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getPrivateEndpointConnection.js new file mode 100644 index 000000000000..cfa27e25428a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getSnapshot.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getSnapshot.js new file mode 100644 index 000000000000..7efb39639237 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getUpgradeProfileForAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForAgentPool.js new file mode 100644 index 000000000000..04201a47715a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/getUpgradeProfileForManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/getUpgradeProfileForManagedCluster.js new file mode 100644 index 000000000000..66d391247cae --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listAgentPoolsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listAgentPoolsByManagedCluster.js new file mode 100644 index 000000000000..d46bdd85cb0c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listAvailableOperationsForTheContainerServiceResourceProvider.js new file mode 100644 index 000000000000..832f25008893 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listMaintenanceConfigurationsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listMaintenanceConfigurationsByManagedCluster.js new file mode 100644 index 000000000000..813faef67060 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listManagedClusters.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listManagedClusters.js new file mode 100644 index 000000000000..8c81bd209a2c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listOutboundNetworkDependenciesEndpointsByManagedCluster.js new file mode 100644 index 000000000000..67ec0e54a2cf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listPrivateEndpointConnectionsByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateEndpointConnectionsByManagedCluster.js new file mode 100644 index 000000000000..413c36392717 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listPrivateLinkResourcesByManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listPrivateLinkResourcesByManagedCluster.js new file mode 100644 index 000000000000..94aeffb357e4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listSnapshots.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshots.js new file mode 100644 index 000000000000..44ece47204c1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/listSnapshotsByResourceGroup.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/listSnapshotsByResourceGroup.js new file mode 100644 index 000000000000..8fe36c3de87e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/maintenanceConfigurationsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsCreateOrUpdateSample.js new file mode 100644 index 000000000000..00938634c278 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/maintenanceConfigurationsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsDeleteSample.js new file mode 100644 index 000000000000..665d285517d5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/maintenanceConfigurationsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsGetSample.js new file mode 100644 index 000000000000..415e4d203db7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/maintenanceConfigurationsListByManagedClusterSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/maintenanceConfigurationsListByManagedClusterSample.js new file mode 100644 index 000000000000..6ad877791135 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersCreateOrUpdateSample.js new file mode 100644 index 000000000000..07cfa7e1bb22 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersCreateOrUpdateSample.js @@ -0,0 +1,1362 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/javascript/managedClustersDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersDeleteSample.js new file mode 100644 index 000000000000..1fa3f9011ca5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersGetAccessProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetAccessProfileSample.js new file mode 100644 index 000000000000..e8c1bfec512f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersGetCommandResultSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetCommandResultSample.js new file mode 100644 index 000000000000..fbffb666e8bb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/stable/2022-03-01/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/javascript/managedClustersGetOSOptionsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetOSOptionsSample.js new file mode 100644 index 000000000000..d343672eb6d2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetSample.js new file mode 100644 index 000000000000..4ccc26dcdaf5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersGetUpgradeProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersGetUpgradeProfileSample.js new file mode 100644 index 000000000000..af692e0967ff --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListByResourceGroupSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListByResourceGroupSample.js new file mode 100644 index 000000000000..b5b5750c1fa4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListClusterAdminCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterAdminCredentialsSample.js new file mode 100644 index 000000000000..2d83587236ac --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterMonitoringUserCredentialsSample.js new file mode 100644 index 000000000000..196f68b52468 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListClusterUserCredentialsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListClusterUserCredentialsSample.js new file mode 100644 index 000000000000..cccb570562d5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListOutboundNetworkDependenciesEndpointsSample.js new file mode 100644 index 000000000000..3a18959db8f7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersListSample.js new file mode 100644 index 000000000000..b11d5d7ea641 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersResetAadProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetAadProfileSample.js new file mode 100644 index 000000000000..c5de17ebf705 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersResetServicePrincipalProfileSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersResetServicePrincipalProfileSample.js new file mode 100644 index 000000000000..f4cdcc40292c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersRotateClusterCertificatesSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRotateClusterCertificatesSample.js new file mode 100644 index 000000000000..b6e1d30d0992 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersRunCommandSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersRunCommandSample.js new file mode 100644 index 000000000000..bf1688d5568f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersStartSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStartSample.js new file mode 100644 index 000000000000..5013d3d2a273 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersStopSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersStopSample.js new file mode 100644 index 000000000000..0d96d5d0f9e8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/managedClustersUpdateTagsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/managedClustersUpdateTagsSample.js new file mode 100644 index 000000000000..b806c579c23d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/operationsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/operationsListSample.js new file mode 100644 index 000000000000..cec4bf4dc2b4 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/package.json b/sdk/containerservice/arm-containerservice/samples/v16/javascript/package.json new file mode 100644 index 000000000000..eb8336c81d74 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/javascript/package.json @@ -0,0 +1,32 @@ +{ + "name": "@azure-samples/arm-containerservice-js", + "private": true, + "version": "1.0.0", + "description": " client library samples for JavaScript", + "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": "latest", + "dotenv": "latest", + "@azure/identity": "^2.0.1" + } +} diff --git a/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..0b08edb38601 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/privateEndpointConnectionsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..71ef2814cf1d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/privateEndpointConnectionsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..8fa0afc4b355 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/privateEndpointConnectionsUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateEndpointConnectionsUpdateSample.js new file mode 100644 index 000000000000..42d33c8af1fe --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/privateLinkResourcesListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/privateLinkResourcesListSample.js new file mode 100644 index 000000000000..30c631e5d16e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/resetAadProfile.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/resetAadProfile.js new file mode 100644 index 000000000000..4a67f8d62add --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/resetServicePrincipalProfile.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/resetServicePrincipalProfile.js new file mode 100644 index 000000000000..adf16181626c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/resolvePrivateLinkServiceIdPostSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/resolvePrivateLinkServiceIdPostSample.js new file mode 100644 index 000000000000..e182e3ce379f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/resolveThePrivateLinkServiceIdForManagedCluster.js new file mode 100644 index 000000000000..e99122f3969f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/rotateClusterCertificates.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/rotateClusterCertificates.js new file mode 100644 index 000000000000..8b591182309c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/sample.env b/sdk/containerservice/arm-containerservice/samples/v16/javascript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/snapshotsCreateOrUpdateSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsCreateOrUpdateSample.js new file mode 100644 index 000000000000..aad3856739e0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/snapshotsDeleteSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsDeleteSample.js new file mode 100644 index 000000000000..ff59af66cff0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/snapshotsGetSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsGetSample.js new file mode 100644 index 000000000000..c3e6918fdd18 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/snapshotsListByResourceGroupSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListByResourceGroupSample.js new file mode 100644 index 000000000000..aed7956d564d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/snapshotsListSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsListSample.js new file mode 100644 index 000000000000..e1c471ed8865 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/snapshotsUpdateTagsSample.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/snapshotsUpdateTagsSample.js new file mode 100644 index 000000000000..266c5f60d219 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/javascript/startAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/startAgentPool.js new file mode 100644 index 000000000000..0780151e860b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/startManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/startManagedCluster.js new file mode 100644 index 000000000000..c0a38c5e48fa --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/stopAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/stopAgentPool.js new file mode 100644 index 000000000000..ce63fdf520f0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/stopManagedCluster.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/stopManagedCluster.js new file mode 100644 index 000000000000..602aa781a82b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/submitNewCommand.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/submitNewCommand.js new file mode 100644 index 000000000000..38dddc196b31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/updateAgentPool.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateAgentPool.js new file mode 100644 index 000000000000..f764ba5d3d43 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/updateManagedClusterTags.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateManagedClusterTags.js new file mode 100644 index 000000000000..c35c2c855494 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/updatePrivateEndpointConnection.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/updatePrivateEndpointConnection.js new file mode 100644 index 000000000000..f1dbc72f8dd0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/updateSnapshotTags.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/updateSnapshotTags.js new file mode 100644 index 000000000000..e841a03b8f02 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/javascript/upgradeAgentPoolNodeImageVersion.js b/sdk/containerservice/arm-containerservice/samples/v16/javascript/upgradeAgentPoolNodeImageVersion.js new file mode 100644 index 000000000000..5ad0efbfa5d0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/README.md b/sdk/containerservice/arm-containerservice/samples/v16/typescript/README.md new file mode 100644 index 000000000000..5ae030a45660 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/typescript/README.md @@ -0,0 +1,299 @@ +# client library samples for TypeScript + +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/stable/2022-03-01/examples/AgentPoolsCreate_Snapshot.json | +| [agentPoolsDeleteSample.ts][agentpoolsdeletesample] | 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 | +| [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/stable/2022-03-01/examples/AgentPoolsGetAgentPoolAvailableVersions.json | +| [agentPoolsGetSample.ts][agentpoolsgetsample] | Gets the specified managed cluster agent pool. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/AgentPoolsGet.json | +| [agentPoolsGetUpgradeProfileSample.ts][agentpoolsgetupgradeprofilesample] | 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 | +| [agentPoolsListSample.ts][agentpoolslistsample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/MaintenanceConfigurationsCreate_Update.json | +| [maintenanceConfigurationsDeleteSample.ts][maintenanceconfigurationsdeletesample] | Deletes a maintenance configuration. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/MaintenanceConfigurationsList.json | +| [managedClustersCreateOrUpdateSample.ts][managedclusterscreateorupdatesample] | Creates or updates a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersCreate_Snapshot.json | +| [managedClustersDeleteSample.ts][managedclustersdeletesample] | Deletes a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/RunCommandResultFailed.json | +| [managedClustersGetOSOptionsSample.ts][managedclustersgetosoptionssample] | 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 | +| [managedClustersGetSample.ts][managedclustersgetsample] | Gets a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersGet.json | +| [managedClustersGetUpgradeProfileSample.ts][managedclustersgetupgradeprofilesample] | 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 | +| [managedClustersListByResourceGroupSample.ts][managedclusterslistbyresourcegroupsample] | 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 | +| [managedClustersListClusterAdminCredentialsSample.ts][managedclusterslistclusteradmincredentialssample] | 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 | +| [managedClustersListClusterMonitoringUserCredentialsSample.ts][managedclusterslistclustermonitoringusercredentialssample] | 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 | +| [managedClustersListClusterUserCredentialsSample.ts][managedclusterslistclusterusercredentialssample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersList.json | +| [managedClustersResetAadProfileSample.ts][managedclustersresetaadprofilesample] | 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 | +| [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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersRotateClusterCertificates.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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/ManagedClustersStop.json | +| [managedClustersUpdateTagsSample.ts][managedclustersupdatetagssample] | Updates tags on a managed cluster. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/ManagedClustersUpdateTags.json | +| [operationsListSample.ts][operationslistsample] | Gets a list of operations. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/Operation_List.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/PrivateEndpointConnectionsList.json | +| [privateEndpointConnectionsUpdateSample.ts][privateendpointconnectionsupdatesample] | Updates a private endpoint connection. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/SnapshotsCreate.json | +| [snapshotsDeleteSample.ts][snapshotsdeletesample] | Deletes a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/examples/SnapshotsDelete.json | +| [snapshotsGetSample.ts][snapshotsgetsample] | Gets a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/examples/SnapshotsList.json | +| [snapshotsUpdateTagsSample.ts][snapshotsupdatetagssample] | Updates tags on a snapshot. x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/stable/2022-03-01/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/typescript/src/agentPoolsCreateOrUpdateSample.ts +[agentpoolsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsDeleteSample.ts +[agentpoolsgetavailableagentpoolversionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts +[agentpoolsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetSample.ts +[agentpoolsgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetUpgradeProfileSample.ts +[agentpoolslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsListSample.ts +[agentpoolsupgradenodeimageversionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts +[commandfailedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandFailedResult.ts +[commandsucceedresult]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandSucceedResult.ts +[createagentpoolusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts +[createagentpoolwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts +[createagentpoolwithephemeralosdisk]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEphemeralOSDisk.ts +[createagentpoolwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithFipsEnabledOS.ts +[createagentpoolwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithGpumig.ts +[createagentpoolwithkrustletandthewasiruntime]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts +[createagentpoolwithkubeletconfigandlinuxosconfig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts +[createagentpoolwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithOssku.ts +[createagentpoolwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithPpg.ts +[createagentpoolwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithUltraSsdEnabled.ts +[createmanagedclusterusinganagentpoolsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts +[createmanagedclusterwithaksmanagednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts +[createmanagedclusterwithencryptionathostenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts +[createmanagedclusterwithfipsenabledos]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithFipsEnabledOS.ts +[createmanagedclusterwithgpumig]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithGpumig.ts +[createmanagedclusterwithhttpproxyconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithHttpProxyConfigured.ts +[createmanagedclusterwithnodepublicipprefix]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts +[createmanagedclusterwithossku]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithOssku.ts +[createmanagedclusterwithpodidentityenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPodIdentityEnabled.ts +[createmanagedclusterwithppg]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPpg.ts +[createmanagedclusterwithruncommanddisabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithRunCommandDisabled.ts +[createmanagedclusterwithsecurityprofileconfigured]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts +[createmanagedclusterwithultrassdenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUltraSsdEnabled.ts +[createmanagedclusterwithuserassignednatgatewayasoutboundtype]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts +[createmanagedprivateclusterwithfqdnsubdomainspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts +[createmanagedprivateclusterwithpublicfqdnspecified]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts +[createorupdateaadmanagedclusterwithenableazurerbac]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts +[createorupdateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAgentPool.ts +[createorupdatemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateMaintenanceConfiguration.ts +[createorupdatemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedCluster.ts +[createorupdatemanagedclusterwithdualstacknetworking]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts +[createorupdatemanagedclusterwithenableahub]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts +[createorupdatemanagedclusterwithwindowsgmsaenabled]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts +[createorupdatesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateSnapshot.ts +[createspotagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createSpotAgentPool.ts +[deleteagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteAgentPool.ts +[deletemaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteMaintenanceConfiguration.ts +[deletemanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteManagedCluster.ts +[deleteprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deletePrivateEndpointConnection.ts +[deletesnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteSnapshot.ts +[getagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAgentPool.ts +[getavailableversionsforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAvailableVersionsForAgentPool.ts +[getcontainerserviceosoptions]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getContainerServiceOSOptions.ts +[getmaintenanceconfiguration]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getMaintenanceConfiguration.ts +[getmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedCluster.ts +[getmanagedclustersbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedClustersByResourceGroup.ts +[getprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getPrivateEndpointConnection.ts +[getsnapshot]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getSnapshot.ts +[getupgradeprofileforagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForAgentPool.ts +[getupgradeprofileformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForManagedCluster.ts +[listagentpoolsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAgentPoolsByManagedCluster.ts +[listavailableoperationsforthecontainerserviceresourceprovider]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts +[listmaintenanceconfigurationsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts +[listmanagedclusters]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listManagedClusters.ts +[listoutboundnetworkdependenciesendpointsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts +[listprivateendpointconnectionsbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts +[listprivatelinkresourcesbymanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateLinkResourcesByManagedCluster.ts +[listsnapshots]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshots.ts +[listsnapshotsbyresourcegroup]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshotsByResourceGroup.ts +[maintenanceconfigurationscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts +[maintenanceconfigurationsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsDeleteSample.ts +[maintenanceconfigurationsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsGetSample.ts +[maintenanceconfigurationslistbymanagedclustersample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts +[managedclusterscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersCreateOrUpdateSample.ts +[managedclustersdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersDeleteSample.ts +[managedclustersgetaccessprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetAccessProfileSample.ts +[managedclustersgetcommandresultsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetCommandResultSample.ts +[managedclustersgetosoptionssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetOSOptionsSample.ts +[managedclustersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetSample.ts +[managedclustersgetupgradeprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetUpgradeProfileSample.ts +[managedclusterslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListByResourceGroupSample.ts +[managedclusterslistclusteradmincredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterAdminCredentialsSample.ts +[managedclusterslistclustermonitoringusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts +[managedclusterslistclusterusercredentialssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterUserCredentialsSample.ts +[managedclusterslistoutboundnetworkdependenciesendpointssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts +[managedclusterslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListSample.ts +[managedclustersresetaadprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetAadProfileSample.ts +[managedclustersresetserviceprincipalprofilesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetServicePrincipalProfileSample.ts +[managedclustersrotateclustercertificatessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRotateClusterCertificatesSample.ts +[managedclustersruncommandsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRunCommandSample.ts +[managedclustersstartsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStartSample.ts +[managedclustersstopsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStopSample.ts +[managedclustersupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersUpdateTagsSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/operationsListSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsListSample.ts +[privateendpointconnectionsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsUpdateSample.ts +[privatelinkresourceslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateLinkResourcesListSample.ts +[resetaadprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetAadProfile.ts +[resetserviceprincipalprofile]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetServicePrincipalProfile.ts +[resolveprivatelinkserviceidpostsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolvePrivateLinkServiceIdPostSample.ts +[resolvetheprivatelinkserviceidformanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts +[rotateclustercertificates]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/rotateClusterCertificates.ts +[snapshotscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsCreateOrUpdateSample.ts +[snapshotsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsDeleteSample.ts +[snapshotsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsGetSample.ts +[snapshotslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListByResourceGroupSample.ts +[snapshotslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListSample.ts +[snapshotsupdatetagssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsUpdateTagsSample.ts +[startagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startAgentPool.ts +[startmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startManagedCluster.ts +[stopagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopAgentPool.ts +[stopmanagedcluster]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopManagedCluster.ts +[submitnewcommand]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/submitNewCommand.ts +[updateagentpool]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateAgentPool.ts +[updatemanagedclustertags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateManagedClusterTags.ts +[updateprivateendpointconnection]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updatePrivateEndpointConnection.ts +[updatesnapshottags]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateSnapshotTags.ts +[upgradeagentpoolnodeimageversion]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/package.json b/sdk/containerservice/arm-containerservice/samples/v16/typescript/package.json new file mode 100644 index 000000000000..9d47e843e06b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/typescript/package.json @@ -0,0 +1,41 @@ +{ + "name": "@azure-samples/arm-containerservice-ts", + "private": true, + "version": "1.0.0", + "description": " client library samples for TypeScript", + "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": "latest", + "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/typescript/sample.env b/sdk/containerservice/arm-containerservice/samples/v16/typescript/sample.env new file mode 100644 index 000000000000..672847a3fea0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/agentPoolsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..58fedd17f05d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsCreateOrUpdateSample.ts @@ -0,0 +1,549 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/typescript/src/agentPoolsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsDeleteSample.ts new file mode 100644 index 000000000000..396a0b209b5d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsDeleteSample.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 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 + */ +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/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetAvailableAgentPoolVersionsSample.ts new file mode 100644 index 000000000000..115f5a5f34cb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/agentPoolsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetSample.ts new file mode 100644 index 000000000000..75f4c4a6d5ca --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/agentPoolsGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsGetUpgradeProfileSample.ts new file mode 100644 index 000000000000..46262c70e617 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/agentPoolsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsListSample.ts new file mode 100644 index 000000000000..81098e5cd6bd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/agentPoolsUpgradeNodeImageVersionSample.ts new file mode 100644 index 000000000000..dc3ab15f3a11 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/commandFailedResult.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandFailedResult.ts new file mode 100644 index 000000000000..9cbe6e5acbf3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/commandSucceedResult.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/commandSucceedResult.ts new file mode 100644 index 000000000000..85dcad6433e6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolUsingAnAgentPoolSnapshot.ts new file mode 100644 index 000000000000..5a603cb40100 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEncryptionAtHostEnabled.ts new file mode 100644 index 000000000000..615937aecc3d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithEphemeralOSDisk.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithEphemeralOSDisk.ts new file mode 100644 index 000000000000..d6ae50f316bf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithFipsEnabledOS.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithFipsEnabledOS.ts new file mode 100644 index 000000000000..10b8598d5f1c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithGpumig.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithGpumig.ts new file mode 100644 index 000000000000..91d06caaed3b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKrustletAndTheWasiRuntime.ts new file mode 100644 index 000000000000..4f1575c18522 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithKubeletConfigAndLinuxOSConfig.ts new file mode 100644 index 000000000000..e3757240cf85 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithOssku.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithOssku.ts new file mode 100644 index 000000000000..f51c123aa8de --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithPpg.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithPpg.ts new file mode 100644 index 000000000000..1267606f3a53 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createAgentPoolWithUltraSsdEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createAgentPoolWithUltraSsdEnabled.ts new file mode 100644 index 000000000000..0e0fb907fc64 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterUsingAnAgentPoolSnapshot.ts new file mode 100644 index 000000000000..5ba30e202d27 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithAksManagedNatGatewayAsOutboundType.ts new file mode 100644 index 000000000000..181970a8528a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithEncryptionAtHostEnabled.ts new file mode 100644 index 000000000000..e505c2f2f7e7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithFipsEnabledOS.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithFipsEnabledOS.ts new file mode 100644 index 000000000000..5617fca5d656 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithGpumig.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithGpumig.ts new file mode 100644 index 000000000000..6f3a230b00f8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithHttpProxyConfigured.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithHttpProxyConfigured.ts new file mode 100644 index 000000000000..4e17d164b0bb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithNodePublicIPPrefix.ts new file mode 100644 index 000000000000..46634263760a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithOssku.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithOssku.ts new file mode 100644 index 000000000000..b21e4283e40e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithPodIdentityEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPodIdentityEnabled.ts new file mode 100644 index 000000000000..baa04d31a2bf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithPpg.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithPpg.ts new file mode 100644 index 000000000000..af05f09ca833 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithRunCommandDisabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithRunCommandDisabled.ts new file mode 100644 index 000000000000..9fb35f651f81 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithSecurityProfileConfigured.ts new file mode 100644 index 000000000000..da11d929dade --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithUltraSsdEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUltraSsdEnabled.ts new file mode 100644 index 000000000000..e5fb7f045345 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedClusterWithUserAssignedNatGatewayAsOutboundType.ts new file mode 100644 index 000000000000..646696e3e0f2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithFqdnSubdomainSpecified.ts new file mode 100644 index 000000000000..75e255b95aa5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createManagedPrivateClusterWithPublicFqdnSpecified.ts new file mode 100644 index 000000000000..3e5da0c46707 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAadManagedClusterWithEnableAzureRbac.ts new file mode 100644 index 000000000000..63110d7ea12f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateAgentPool.ts new file mode 100644 index 000000000000..349b36b7e42e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateMaintenanceConfiguration.ts new file mode 100644 index 000000000000..771591bddf3e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedCluster.ts new file mode 100644 index 000000000000..da3f2aa83499 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithDualStackNetworking.ts new file mode 100644 index 000000000000..299da4d06149 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithEnableAhub.ts new file mode 100644 index 000000000000..1acc1632c1a1 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateManagedClusterWithWindowsGMsaEnabled.ts new file mode 100644 index 000000000000..5ee8718cdaa0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createOrUpdateSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createOrUpdateSnapshot.ts new file mode 100644 index 000000000000..0d67d5eb4bf5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/createSpotAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/createSpotAgentPool.ts new file mode 100644 index 000000000000..189774c3f7d9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/deleteAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteAgentPool.ts new file mode 100644 index 000000000000..245416a8635e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/deleteMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteMaintenanceConfiguration.ts new file mode 100644 index 000000000000..a06d13b5bc53 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/deleteManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteManagedCluster.ts new file mode 100644 index 000000000000..0f9bb5c77ea6 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/deletePrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deletePrivateEndpointConnection.ts new file mode 100644 index 000000000000..5b9e73a1a0fb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/deleteSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/deleteSnapshot.ts new file mode 100644 index 000000000000..61aa8776211d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAgentPool.ts new file mode 100644 index 000000000000..8788993c44fb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getAvailableVersionsForAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getAvailableVersionsForAgentPool.ts new file mode 100644 index 000000000000..ad6514519638 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getContainerServiceOSOptions.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getContainerServiceOSOptions.ts new file mode 100644 index 000000000000..f42a58741c0a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getMaintenanceConfiguration.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getMaintenanceConfiguration.ts new file mode 100644 index 000000000000..bb4f4c8c3d80 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedCluster.ts new file mode 100644 index 000000000000..3836bfe3a4d3 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getManagedClustersByResourceGroup.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getManagedClustersByResourceGroup.ts new file mode 100644 index 000000000000..dec78a9f2d26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getPrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getPrivateEndpointConnection.ts new file mode 100644 index 000000000000..f8ab7dd6c387 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getSnapshot.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getSnapshot.ts new file mode 100644 index 000000000000..66dba8b551fa --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getUpgradeProfileForAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForAgentPool.ts new file mode 100644 index 000000000000..b88f86b90221 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/getUpgradeProfileForManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/getUpgradeProfileForManagedCluster.ts new file mode 100644 index 000000000000..1531bad68b0c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listAgentPoolsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAgentPoolsByManagedCluster.ts new file mode 100644 index 000000000000..c169b98e728d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listAvailableOperationsForTheContainerServiceResourceProvider.ts new file mode 100644 index 000000000000..3f2872f40265 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listMaintenanceConfigurationsByManagedCluster.ts new file mode 100644 index 000000000000..8851d5d4f366 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listManagedClusters.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listManagedClusters.ts new file mode 100644 index 000000000000..db2d31fff72d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listOutboundNetworkDependenciesEndpointsByManagedCluster.ts new file mode 100644 index 000000000000..aa4127525805 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateEndpointConnectionsByManagedCluster.ts new file mode 100644 index 000000000000..efc52f9b27b7 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listPrivateLinkResourcesByManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listPrivateLinkResourcesByManagedCluster.ts new file mode 100644 index 000000000000..b6d6769d5a1f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listSnapshots.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshots.ts new file mode 100644 index 000000000000..886b67511f26 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/listSnapshotsByResourceGroup.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/listSnapshotsByResourceGroup.ts new file mode 100644 index 000000000000..902260abc84e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..537f5add6c4f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/maintenanceConfigurationsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsDeleteSample.ts new file mode 100644 index 000000000000..c116255eeb32 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/maintenanceConfigurationsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsGetSample.ts new file mode 100644 index 000000000000..d91f9c861c22 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/maintenanceConfigurationsListByManagedClusterSample.ts new file mode 100644 index 000000000000..b502675c22c0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersCreateOrUpdateSample.ts new file mode 100644 index 000000000000..e8e6fd626b3f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersCreateOrUpdateSample.ts @@ -0,0 +1,1365 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code 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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/stable/2022-03-01/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/typescript/src/managedClustersDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersDeleteSample.ts new file mode 100644 index 000000000000..b51710aa586e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersGetAccessProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetAccessProfileSample.ts new file mode 100644 index 000000000000..0c1a617e9ab5 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersGetCommandResultSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetCommandResultSample.ts new file mode 100644 index 000000000000..0026f19b615b --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/stable/2022-03-01/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/typescript/src/managedClustersGetOSOptionsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetOSOptionsSample.ts new file mode 100644 index 000000000000..3b777c150258 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetSample.ts new file mode 100644 index 000000000000..d8306bfe7565 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersGetUpgradeProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersGetUpgradeProfileSample.ts new file mode 100644 index 000000000000..3df430890cae --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListByResourceGroupSample.ts new file mode 100644 index 000000000000..915a40844662 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListClusterAdminCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterAdminCredentialsSample.ts new file mode 100644 index 000000000000..f5bedc881559 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterMonitoringUserCredentialsSample.ts new file mode 100644 index 000000000000..858c00c20cdf --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListClusterUserCredentialsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListClusterUserCredentialsSample.ts new file mode 100644 index 000000000000..a73280e33673 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListOutboundNetworkDependenciesEndpointsSample.ts new file mode 100644 index 000000000000..5d0a98a64bb9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersListSample.ts new file mode 100644 index 000000000000..391c7504ca32 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersResetAadProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetAadProfileSample.ts new file mode 100644 index 000000000000..5d8ff496b76f --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersResetServicePrincipalProfileSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersResetServicePrincipalProfileSample.ts new file mode 100644 index 000000000000..9d25266e6f4c --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersRotateClusterCertificatesSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRotateClusterCertificatesSample.ts new file mode 100644 index 000000000000..a2aa4e730e76 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersRunCommandSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersRunCommandSample.ts new file mode 100644 index 000000000000..4003085b7458 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersStartSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStartSample.ts new file mode 100644 index 000000000000..603ec4bac8a9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersStopSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersStopSample.ts new file mode 100644 index 000000000000..edd4387a2f6e --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/managedClustersUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/managedClustersUpdateTagsSample.ts new file mode 100644 index 000000000000..4da15c175c31 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/operationsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..d6bbf405fb93 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..382657bf81ff --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..83ad56405d17 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..0eadd58955fc --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/privateEndpointConnectionsUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateEndpointConnectionsUpdateSample.ts new file mode 100644 index 000000000000..952bd66abaaa --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/privateLinkResourcesListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/privateLinkResourcesListSample.ts new file mode 100644 index 000000000000..9b54caef58f8 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/resetAadProfile.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetAadProfile.ts new file mode 100644 index 000000000000..d452ca0f6cdb --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/resetServicePrincipalProfile.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resetServicePrincipalProfile.ts new file mode 100644 index 000000000000..f33bf51974a0 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/resolvePrivateLinkServiceIdPostSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolvePrivateLinkServiceIdPostSample.ts new file mode 100644 index 000000000000..d22b82b02762 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/resolveThePrivateLinkServiceIdForManagedCluster.ts new file mode 100644 index 000000000000..dff4d8559a95 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/rotateClusterCertificates.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/rotateClusterCertificates.ts new file mode 100644 index 000000000000..002290ef1f4a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/snapshotsCreateOrUpdateSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsCreateOrUpdateSample.ts new file mode 100644 index 000000000000..f7585ccb5d92 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/snapshotsDeleteSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsDeleteSample.ts new file mode 100644 index 000000000000..e4f439808be9 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/snapshotsGetSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsGetSample.ts new file mode 100644 index 000000000000..47074edc1596 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/snapshotsListByResourceGroupSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListByResourceGroupSample.ts new file mode 100644 index 000000000000..c99508f1d098 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/snapshotsListSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsListSample.ts new file mode 100644 index 000000000000..8237cb7e4ee2 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/snapshotsUpdateTagsSample.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/snapshotsUpdateTagsSample.ts new file mode 100644 index 000000000000..53cccd577d4a --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/stable/2022-03-01/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/typescript/src/startAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startAgentPool.ts new file mode 100644 index 000000000000..da11fe149751 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/startManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/startManagedCluster.ts new file mode 100644 index 000000000000..c651026cee93 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/stopAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopAgentPool.ts new file mode 100644 index 000000000000..d097562b4b3d --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/stopManagedCluster.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/stopManagedCluster.ts new file mode 100644 index 000000000000..ec7580095818 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/submitNewCommand.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/submitNewCommand.ts new file mode 100644 index 000000000000..d491445abc39 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/updateAgentPool.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateAgentPool.ts new file mode 100644 index 000000000000..35b855be63cd --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/updateManagedClusterTags.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateManagedClusterTags.ts new file mode 100644 index 000000000000..710cc39e6dbc --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/updatePrivateEndpointConnection.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updatePrivateEndpointConnection.ts new file mode 100644 index 000000000000..0d77112cd0ab --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/updateSnapshotTags.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/updateSnapshotTags.ts new file mode 100644 index 000000000000..f98829e3ea01 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/src/upgradeAgentPoolNodeImageVersion.ts b/sdk/containerservice/arm-containerservice/samples/v16/typescript/src/upgradeAgentPoolNodeImageVersion.ts new file mode 100644 index 000000000000..e4b7d5d4e892 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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/typescript/tsconfig.json b/sdk/containerservice/arm-containerservice/samples/v16/typescript/tsconfig.json new file mode 100644 index 000000000000..416c2dd82e00 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/samples/v16/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 5f83d89a8bf3..833ee1126d83 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -7,6 +7,7 @@ */ import * as coreClient from "@azure/core-client"; +import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, @@ -62,7 +63,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-containerservice/15.2.1`; + const packageDetails = `azsdk-js-arm-containerservice/16.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -81,12 +82,35 @@ export class ContainerServiceClient extends coreClient.ServiceClient { options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); + + if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + (pipelinePolicy) => + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName + ); + if (!bearerTokenAuthenticationPolicyFound) { + this.pipeline.removePolicy({ + name: coreRestPipeline.bearerTokenAuthenticationPolicyName + }); + this.pipeline.addPolicy( + coreRestPipeline.bearerTokenAuthenticationPolicy({ + scopes: `${optionsWithDefaults.baseUri}/.default`, + challengeCallbacks: { + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge + } + }) + ); + } + } // Parameter assignments this.subscriptionId = subscriptionId; // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-02-01"; + this.apiVersion = options.apiVersion || "2022-03-01"; this.operations = new OperationsImpl(this); this.managedClusters = new ManagedClustersImpl(this); this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this); diff --git a/sdk/containerservice/arm-containerservice/src/models/index.ts b/sdk/containerservice/arm-containerservice/src/models/index.ts index 6d06b7a79713..f0eed7e2ce5c 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -736,10 +736,6 @@ export interface Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; - /** Resource location */ - location: string; - /** Resource tags */ - tags?: { [propertyName: string]: string }; } /** Metadata pertaining to creation and last modification of the resource. */ @@ -1143,6 +1139,34 @@ export interface ContainerServiceVMDiagnostics { readonly storageUri?: string; } +/** Storage profile for the container service cluster. */ +export interface ManagedClusterStorageProfile { + /** AzureDisk CSI Driver settings for the storage profile. */ + diskCSIDriver?: ManagedClusterStorageProfileDiskCSIDriver; + /** AzureFile CSI Driver settings for the storage profile. */ + fileCSIDriver?: ManagedClusterStorageProfileFileCSIDriver; + /** Snapshot Controller settings for the storage profile. */ + snapshotController?: ManagedClusterStorageProfileSnapshotController; +} + +/** AzureDisk CSI Driver settings for the storage profile. */ +export interface ManagedClusterStorageProfileDiskCSIDriver { + /** Whether to enable AzureDisk CSI Driver. The default value is true. */ + enabled?: boolean; +} + +/** AzureFile CSI Driver settings for the storage profile. */ +export interface ManagedClusterStorageProfileFileCSIDriver { + /** Whether to enable AzureFile CSI Driver. The default value is true. */ + enabled?: boolean; +} + +/** Snapshot Controller settings for the storage profile. */ +export interface ManagedClusterStorageProfileSnapshotController { + /** Whether to enable Snapshot Controller. The default value is true. */ + enabled?: boolean; +} + /** Profile for the container service agent pool. */ export type ManagedClusterAgentPoolProfile = ManagedClusterAgentPoolProfileProperties & { /** Windows agent pool names must be 6 characters or less. */ @@ -1152,8 +1176,117 @@ export type ManagedClusterAgentPoolProfile = ManagedClusterAgentPoolProfilePrope /** Information of user assigned identity used by this add-on. */ export type ManagedClusterAddonProfileIdentity = UserAssignedIdentity & {}; +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export type TrackedResource = Resource & { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The geo-location where the resource lives */ + location: string; +}; + +/** See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. */ +export type MaintenanceConfiguration = SubResource & { + /** + * The system metadata relating to this resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; + /** If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. */ + timeInWeek?: TimeInWeek[]; + /** Time slots on which upgrade is not allowed. */ + notAllowedTime?: TimeSpan[]; +}; + +/** Agent Pool. */ +export type AgentPool = SubResource & { + /** 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. */ + count?: number; + /** VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions */ + vmSize?: string; + /** OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. */ + osDiskSizeGB?: number; + /** The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). */ + osDiskType?: OSDiskType; + /** Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. */ + kubeletDiskType?: KubeletDiskType; + /** Determines the type of workload a node can run. */ + workloadRuntime?: WorkloadRuntime; + /** 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} */ + podSubnetID?: string; + /** The maximum number of pods that can run on a node. */ + maxPods?: number; + /** The operating system type. The default is Linux. */ + osType?: OSType; + /** Specifies an OS SKU. This value must not be specified if OSType is Windows. */ + osSKU?: Ossku; + /** The maximum number of nodes for auto-scaling */ + maxCount?: number; + /** The minimum number of nodes for auto-scaling */ + minCount?: number; + /** Whether to enable auto-scaler */ + enableAutoScaling?: boolean; + /** This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. */ + scaleDownMode?: ScaleDownMode; + /** The type of Agent Pool. */ + 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). */ + orchestratorVersion?: string; + /** + * The version of node image + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeImageVersion?: string; + /** Settings for upgrading the agentpool */ + upgradeSettings?: AgentPoolUpgradeSettings; + /** + * The current deployment or provisioning state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: string; + /** When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded */ + powerState?: PowerState; + /** The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. */ + availabilityZones?: string[]; + /** Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. */ + enableNodePublicIP?: boolean; + /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} */ + nodePublicIPPrefixID?: string; + /** The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. */ + scaleSetPriority?: ScaleSetPriority; + /** This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. */ + scaleSetEvictionPolicy?: ScaleSetEvictionPolicy; + /** Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) */ + spotMaxPrice?: number; + /** The tags to be persisted on the agent pool virtual machine scale set. */ + tags?: { [propertyName: string]: string }; + /** The node labels to be persisted across all nodes in agent pool. */ + nodeLabels?: { [propertyName: string]: string }; + /** The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ + nodeTaints?: string[]; + /** The ID for Proximity Placement Group. */ + proximityPlacementGroupID?: string; + /** The Kubelet configuration on the agent pool nodes. */ + kubeletConfig?: KubeletConfig; + /** The OS configuration of Linux agent nodes. */ + linuxOSConfig?: LinuxOSConfig; + /** This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption */ + enableEncryptionAtHost?: boolean; + /** Whether to enable UltraSSD */ + enableUltraSSD?: boolean; + /** See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. */ + enableFips?: boolean; + /** GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. */ + 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; +}; + /** Managed cluster. */ -export type ManagedCluster = Resource & { +export type ManagedCluster = TrackedResource & { /** The managed cluster SKU. */ sku?: ManagedClusterSKU; /** The extended location of the Virtual Machine. */ @@ -1241,13 +1374,13 @@ export type ManagedCluster = Resource & { }; /** Managed cluster Access Profile. */ -export type ManagedClusterAccessProfile = Resource & { +export type ManagedClusterAccessProfile = TrackedResource & { /** Base64-encoded Kubernetes configuration file. */ kubeConfig?: Uint8Array; }; /** A node pool snapshot resource. */ -export type Snapshot = Resource & { +export type Snapshot = TrackedResource & { /** CreationData to be used to specify the source agent pool resource ID to create this snapshot. */ creationData?: CreationData; /** The type of a snapshot. The default is NodePool. */ @@ -1284,107 +1417,6 @@ export type Snapshot = Resource & { readonly enableFips?: boolean; }; -/** See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. */ -export type MaintenanceConfiguration = SubResource & { - /** - * The system metadata relating to this resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly systemData?: SystemData; - /** If two array entries specify the same day of the week, the applied configuration is the union of times in both entries. */ - timeInWeek?: TimeInWeek[]; - /** Time slots on which upgrade is not allowed. */ - notAllowedTime?: TimeSpan[]; -}; - -/** Agent Pool. */ -export type AgentPool = SubResource & { - /** 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. */ - count?: number; - /** VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions */ - vmSize?: string; - /** OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. */ - osDiskSizeGB?: number; - /** The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os). */ - osDiskType?: OSDiskType; - /** Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage. */ - kubeletDiskType?: KubeletDiskType; - /** Determines the type of workload a node can run. */ - workloadRuntime?: WorkloadRuntime; - /** 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} */ - podSubnetID?: string; - /** The maximum number of pods that can run on a node. */ - maxPods?: number; - /** The operating system type. The default is Linux. */ - osType?: OSType; - /** Specifies an OS SKU. This value must not be specified if OSType is Windows. */ - osSKU?: Ossku; - /** The maximum number of nodes for auto-scaling */ - maxCount?: number; - /** The minimum number of nodes for auto-scaling */ - minCount?: number; - /** Whether to enable auto-scaler */ - enableAutoScaling?: boolean; - /** This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete. */ - scaleDownMode?: ScaleDownMode; - /** The type of Agent Pool. */ - 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). */ - orchestratorVersion?: string; - /** - * The version of node image - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nodeImageVersion?: string; - /** Settings for upgrading the agentpool */ - upgradeSettings?: AgentPoolUpgradeSettings; - /** - * The current deployment or provisioning state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; - /** When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded */ - powerState?: PowerState; - /** The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'. */ - availabilityZones?: string[]; - /** Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false. */ - enableNodePublicIP?: boolean; - /** This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName} */ - nodePublicIPPrefixID?: string; - /** The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'. */ - scaleSetPriority?: ScaleSetPriority; - /** This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'. */ - scaleSetEvictionPolicy?: ScaleSetEvictionPolicy; - /** Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing) */ - spotMaxPrice?: number; - /** The tags to be persisted on the agent pool virtual machine scale set. */ - tags?: { [propertyName: string]: string }; - /** The node labels to be persisted across all nodes in agent pool. */ - nodeLabels?: { [propertyName: string]: string }; - /** The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. */ - nodeTaints?: string[]; - /** The ID for Proximity Placement Group. */ - proximityPlacementGroupID?: string; - /** The Kubelet configuration on the agent pool nodes. */ - kubeletConfig?: KubeletConfig; - /** The OS configuration of Linux agent nodes. */ - linuxOSConfig?: LinuxOSConfig; - /** This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption */ - enableEncryptionAtHost?: boolean; - /** Whether to enable UltraSSD */ - enableUltraSSD?: boolean; - /** See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details. */ - enableFips?: boolean; - /** GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU. */ - 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; -}; - /** Defines headers for AgentPools_upgradeNodeImageVersion operation. */ export interface AgentPoolsUpgradeNodeImageVersionHeaders { /** URL to query for status of the operation. */ diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index 3a9ab68fc97e..9f41f45edf12 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -2091,20 +2091,6 @@ export const Resource: coreClient.CompositeMapper = { name: "Composite", className: "SystemData" } - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String" - } - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } } } } @@ -3085,6 +3071,81 @@ export const ContainerServiceVMDiagnostics: coreClient.CompositeMapper = { } }; +export const ManagedClusterStorageProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfile", + modelProperties: { + diskCSIDriver: { + serializedName: "diskCSIDriver", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileDiskCSIDriver" + } + }, + fileCSIDriver: { + serializedName: "fileCSIDriver", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileFileCSIDriver" + } + }, + snapshotController: { + serializedName: "snapshotController", + type: { + name: "Composite", + className: "ManagedClusterStorageProfileSnapshotController" + } + } + } + } +}; + +export const ManagedClusterStorageProfileDiskCSIDriver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileDiskCSIDriver", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedClusterStorageProfileFileCSIDriver: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileFileCSIDriver", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + +export const ManagedClusterStorageProfileSnapshotController: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterStorageProfileSnapshotController", + modelProperties: { + enabled: { + serializedName: "enabled", + type: { + name: "Boolean" + } + } + } + } +}; + export const ManagedClusterAgentPoolProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3115,642 +3176,666 @@ export const ManagedClusterAddonProfileIdentity: coreClient.CompositeMapper = { } }; -export const ManagedCluster: coreClient.CompositeMapper = { +export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ManagedCluster", + className: "TrackedResource", modelProperties: { ...Resource.type.modelProperties, - sku: { - serializedName: "sku", + tags: { + serializedName: "tags", type: { - name: "Composite", - className: "ManagedClusterSKU" + name: "Dictionary", + value: { type: { name: "String" } } } }, - extendedLocation: { - serializedName: "extendedLocation", + location: { + serializedName: "location", + required: true, type: { - name: "Composite", - className: "ExtendedLocation" + name: "String" } - }, - identity: { - serializedName: "identity", + } + } + } +}; + +export const MaintenanceConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MaintenanceConfiguration", + modelProperties: { + ...SubResource.type.modelProperties, + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "ManagedClusterIdentity" + className: "SystemData" } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + timeInWeek: { + serializedName: "properties.timeInWeek", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeInWeek" + } + } } }, - powerState: { - serializedName: "properties.powerState", + notAllowedTime: { + serializedName: "properties.notAllowedTime", type: { - name: "Composite", - className: "PowerState" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "TimeSpan" + } + } } - }, - maxAgentPools: { - serializedName: "properties.maxAgentPools", - readOnly: true, + } + } + } +}; + +export const AgentPool: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentPool", + modelProperties: { + ...SubResource.type.modelProperties, + count: { + serializedName: "properties.count", type: { name: "Number" } }, - kubernetesVersion: { - serializedName: "properties.kubernetesVersion", + vmSize: { + serializedName: "properties.vmSize", type: { name: "String" } }, - dnsPrefix: { - serializedName: "properties.dnsPrefix", + osDiskSizeGB: { + constraints: { + InclusiveMaximum: 2048, + InclusiveMinimum: 0 + }, + serializedName: "properties.osDiskSizeGB", + type: { + name: "Number" + } + }, + osDiskType: { + serializedName: "properties.osDiskType", type: { name: "String" } }, - fqdnSubdomain: { - serializedName: "properties.fqdnSubdomain", + kubeletDiskType: { + serializedName: "properties.kubeletDiskType", type: { name: "String" } }, - fqdn: { - serializedName: "properties.fqdn", - readOnly: true, + workloadRuntime: { + serializedName: "properties.workloadRuntime", type: { name: "String" } }, - privateFqdn: { - serializedName: "properties.privateFQDN", - readOnly: true, + vnetSubnetID: { + serializedName: "properties.vnetSubnetID", type: { name: "String" } }, - azurePortalFqdn: { - serializedName: "properties.azurePortalFQDN", - readOnly: true, + podSubnetID: { + serializedName: "properties.podSubnetID", type: { name: "String" } }, - agentPoolProfiles: { - serializedName: "properties.agentPoolProfiles", + maxPods: { + serializedName: "properties.maxPods", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ManagedClusterAgentPoolProfile" - } - } + name: "Number" } }, - linuxProfile: { - serializedName: "properties.linuxProfile", + osType: { + defaultValue: "Linux", + serializedName: "properties.osType", type: { - name: "Composite", - className: "ContainerServiceLinuxProfile" + name: "String" } }, - windowsProfile: { - serializedName: "properties.windowsProfile", + osSKU: { + serializedName: "properties.osSKU", type: { - name: "Composite", - className: "ManagedClusterWindowsProfile" + name: "String" } }, - servicePrincipalProfile: { - serializedName: "properties.servicePrincipalProfile", + maxCount: { + serializedName: "properties.maxCount", type: { - name: "Composite", - className: "ManagedClusterServicePrincipalProfile" + name: "Number" } }, - addonProfiles: { - serializedName: "properties.addonProfiles", + minCount: { + serializedName: "properties.minCount", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "ManagedClusterAddonProfile" } - } + name: "Number" } }, - podIdentityProfile: { - serializedName: "properties.podIdentityProfile", + enableAutoScaling: { + serializedName: "properties.enableAutoScaling", type: { - name: "Composite", - className: "ManagedClusterPodIdentityProfile" + name: "Boolean" } }, - nodeResourceGroup: { - serializedName: "properties.nodeResourceGroup", + scaleDownMode: { + serializedName: "properties.scaleDownMode", type: { name: "String" } }, - enableRbac: { - serializedName: "properties.enableRBAC", + typePropertiesType: { + serializedName: "properties.type", type: { - name: "Boolean" + name: "String" } }, - enablePodSecurityPolicy: { - serializedName: "properties.enablePodSecurityPolicy", + mode: { + serializedName: "properties.mode", type: { - name: "Boolean" + name: "String" } }, - networkProfile: { - serializedName: "properties.networkProfile", - type: { - name: "Composite", - className: "ContainerServiceNetworkProfile" - } - }, - aadProfile: { - serializedName: "properties.aadProfile", - type: { - name: "Composite", - className: "ManagedClusterAADProfile" - } - }, - autoUpgradeProfile: { - serializedName: "properties.autoUpgradeProfile", + orchestratorVersion: { + serializedName: "properties.orchestratorVersion", type: { - name: "Composite", - className: "ManagedClusterAutoUpgradeProfile" + name: "String" } }, - autoScalerProfile: { - serializedName: "properties.autoScalerProfile", + nodeImageVersion: { + serializedName: "properties.nodeImageVersion", + readOnly: true, type: { - name: "Composite", - className: "ManagedClusterPropertiesAutoScalerProfile" + name: "String" } }, - apiServerAccessProfile: { - serializedName: "properties.apiServerAccessProfile", + upgradeSettings: { + serializedName: "properties.upgradeSettings", type: { name: "Composite", - className: "ManagedClusterAPIServerAccessProfile" + className: "AgentPoolUpgradeSettings" } }, - diskEncryptionSetID: { - serializedName: "properties.diskEncryptionSetID", + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, type: { name: "String" } }, - identityProfile: { - serializedName: "properties.identityProfile", + powerState: { + serializedName: "properties.powerState", type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" } - } + name: "Composite", + className: "PowerState" } }, - privateLinkResources: { - serializedName: "properties.privateLinkResources", + availabilityZones: { + serializedName: "properties.availabilityZones", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "PrivateLinkResource" + name: "String" } } } }, - disableLocalAccounts: { - serializedName: "properties.disableLocalAccounts", + enableNodePublicIP: { + serializedName: "properties.enableNodePublicIP", type: { name: "Boolean" } }, - httpProxyConfig: { - serializedName: "properties.httpProxyConfig", + nodePublicIPPrefixID: { + serializedName: "properties.nodePublicIPPrefixID", type: { - name: "Composite", - className: "ManagedClusterHttpProxyConfig" + name: "String" } }, - securityProfile: { - serializedName: "properties.securityProfile", + scaleSetPriority: { + defaultValue: "Regular", + serializedName: "properties.scaleSetPriority", type: { - name: "Composite", - className: "ManagedClusterSecurityProfile" + name: "String" } }, - publicNetworkAccess: { - serializedName: "properties.publicNetworkAccess", + scaleSetEvictionPolicy: { + defaultValue: "Delete", + serializedName: "properties.scaleSetEvictionPolicy", type: { name: "String" } - } - } - } -}; - -export const ManagedClusterAccessProfile: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedClusterAccessProfile", - modelProperties: { - ...Resource.type.modelProperties, - kubeConfig: { - serializedName: "properties.kubeConfig", + }, + spotMaxPrice: { + defaultValue: -1, + serializedName: "properties.spotMaxPrice", type: { - name: "ByteArray" + name: "Number" } - } - } - } -}; - -export const Snapshot: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Snapshot", - modelProperties: { - ...Resource.type.modelProperties, - creationData: { - serializedName: "properties.creationData", + }, + tags: { + serializedName: "properties.tags", type: { - name: "Composite", - className: "CreationData" + name: "Dictionary", + value: { type: { name: "String" } } } }, - snapshotType: { - defaultValue: "NodePool", - serializedName: "properties.snapshotType", + nodeLabels: { + serializedName: "properties.nodeLabels", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - kubernetesVersion: { - serializedName: "properties.kubernetesVersion", - readOnly: true, + nodeTaints: { + serializedName: "properties.nodeTaints", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - nodeImageVersion: { - serializedName: "properties.nodeImageVersion", - readOnly: true, + proximityPlacementGroupID: { + serializedName: "properties.proximityPlacementGroupID", type: { name: "String" } }, - osType: { - defaultValue: "Linux", - serializedName: "properties.osType", - readOnly: true, + kubeletConfig: { + serializedName: "properties.kubeletConfig", type: { - name: "String" + name: "Composite", + className: "KubeletConfig" } }, - osSku: { - serializedName: "properties.osSku", - readOnly: true, + linuxOSConfig: { + serializedName: "properties.linuxOSConfig", type: { - name: "String" + name: "Composite", + className: "LinuxOSConfig" } }, - vmSize: { - serializedName: "properties.vmSize", - readOnly: true, + enableEncryptionAtHost: { + serializedName: "properties.enableEncryptionAtHost", type: { - name: "String" + name: "Boolean" + } + }, + enableUltraSSD: { + serializedName: "properties.enableUltraSSD", + type: { + name: "Boolean" } }, enableFips: { serializedName: "properties.enableFIPS", - readOnly: true, type: { name: "Boolean" } + }, + gpuInstanceProfile: { + serializedName: "properties.gpuInstanceProfile", + type: { + name: "String" + } + }, + creationData: { + serializedName: "properties.creationData", + type: { + name: "Composite", + className: "CreationData" + } } } } }; -export const MaintenanceConfiguration: coreClient.CompositeMapper = { +export const ManagedCluster: coreClient.CompositeMapper = { type: { name: "Composite", - className: "MaintenanceConfiguration", + className: "ManagedCluster", modelProperties: { - ...SubResource.type.modelProperties, - systemData: { - serializedName: "systemData", + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", type: { name: "Composite", - className: "SystemData" + className: "ManagedClusterSKU" } }, - timeInWeek: { - serializedName: "properties.timeInWeek", + extendedLocation: { + serializedName: "extendedLocation", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeInWeek" - } - } + name: "Composite", + className: "ExtendedLocation" } }, - notAllowedTime: { - serializedName: "properties.notAllowedTime", + identity: { + serializedName: "identity", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "TimeSpan" - } - } + name: "Composite", + className: "ManagedClusterIdentity" } - } - } - } -}; - -export const AgentPool: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AgentPool", - modelProperties: { - ...SubResource.type.modelProperties, - count: { - serializedName: "properties.count", + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + powerState: { + serializedName: "properties.powerState", + type: { + name: "Composite", + className: "PowerState" + } + }, + maxAgentPools: { + serializedName: "properties.maxAgentPools", + readOnly: true, type: { name: "Number" } }, - vmSize: { - serializedName: "properties.vmSize", + kubernetesVersion: { + serializedName: "properties.kubernetesVersion", type: { name: "String" } }, - osDiskSizeGB: { - constraints: { - InclusiveMaximum: 2048, - InclusiveMinimum: 0 - }, - serializedName: "properties.osDiskSizeGB", + dnsPrefix: { + serializedName: "properties.dnsPrefix", type: { - name: "Number" + name: "String" } }, - osDiskType: { - serializedName: "properties.osDiskType", + fqdnSubdomain: { + serializedName: "properties.fqdnSubdomain", type: { name: "String" } }, - kubeletDiskType: { - serializedName: "properties.kubeletDiskType", + fqdn: { + serializedName: "properties.fqdn", + readOnly: true, type: { name: "String" } }, - workloadRuntime: { - serializedName: "properties.workloadRuntime", + privateFqdn: { + serializedName: "properties.privateFQDN", + readOnly: true, + type: { + name: "String" + } + }, + azurePortalFqdn: { + serializedName: "properties.azurePortalFQDN", + readOnly: true, type: { name: "String" } }, - vnetSubnetID: { - serializedName: "properties.vnetSubnetID", + agentPoolProfiles: { + serializedName: "properties.agentPoolProfiles", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ManagedClusterAgentPoolProfile" + } + } } }, - podSubnetID: { - serializedName: "properties.podSubnetID", + linuxProfile: { + serializedName: "properties.linuxProfile", type: { - name: "String" + name: "Composite", + className: "ContainerServiceLinuxProfile" } }, - maxPods: { - serializedName: "properties.maxPods", + windowsProfile: { + serializedName: "properties.windowsProfile", type: { - name: "Number" + name: "Composite", + className: "ManagedClusterWindowsProfile" } }, - osType: { - defaultValue: "Linux", - serializedName: "properties.osType", + servicePrincipalProfile: { + serializedName: "properties.servicePrincipalProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterServicePrincipalProfile" } }, - osSKU: { - serializedName: "properties.osSKU", + addonProfiles: { + serializedName: "properties.addonProfiles", type: { - name: "String" + name: "Dictionary", + value: { + type: { name: "Composite", className: "ManagedClusterAddonProfile" } + } } }, - maxCount: { - serializedName: "properties.maxCount", + podIdentityProfile: { + serializedName: "properties.podIdentityProfile", type: { - name: "Number" + name: "Composite", + className: "ManagedClusterPodIdentityProfile" } }, - minCount: { - serializedName: "properties.minCount", + nodeResourceGroup: { + serializedName: "properties.nodeResourceGroup", type: { - name: "Number" + name: "String" } }, - enableAutoScaling: { - serializedName: "properties.enableAutoScaling", + enableRbac: { + serializedName: "properties.enableRBAC", type: { name: "Boolean" } }, - scaleDownMode: { - serializedName: "properties.scaleDownMode", + enablePodSecurityPolicy: { + serializedName: "properties.enablePodSecurityPolicy", type: { - name: "String" + name: "Boolean" } }, - typePropertiesType: { - serializedName: "properties.type", + networkProfile: { + serializedName: "properties.networkProfile", type: { - name: "String" + name: "Composite", + className: "ContainerServiceNetworkProfile" } }, - mode: { - serializedName: "properties.mode", + aadProfile: { + serializedName: "properties.aadProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterAADProfile" } }, - orchestratorVersion: { - serializedName: "properties.orchestratorVersion", + autoUpgradeProfile: { + serializedName: "properties.autoUpgradeProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterAutoUpgradeProfile" } }, - nodeImageVersion: { - serializedName: "properties.nodeImageVersion", - readOnly: true, + autoScalerProfile: { + serializedName: "properties.autoScalerProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterPropertiesAutoScalerProfile" } }, - upgradeSettings: { - serializedName: "properties.upgradeSettings", + apiServerAccessProfile: { + serializedName: "properties.apiServerAccessProfile", type: { name: "Composite", - className: "AgentPoolUpgradeSettings" + className: "ManagedClusterAPIServerAccessProfile" } }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, + diskEncryptionSetID: { + serializedName: "properties.diskEncryptionSetID", type: { name: "String" } }, - powerState: { - serializedName: "properties.powerState", + identityProfile: { + serializedName: "properties.identityProfile", type: { - name: "Composite", - className: "PowerState" + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } } }, - availabilityZones: { - serializedName: "properties.availabilityZones", + privateLinkResources: { + serializedName: "properties.privateLinkResources", type: { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "PrivateLinkResource" } } } }, - enableNodePublicIP: { - serializedName: "properties.enableNodePublicIP", + disableLocalAccounts: { + serializedName: "properties.disableLocalAccounts", type: { name: "Boolean" } }, - nodePublicIPPrefixID: { - serializedName: "properties.nodePublicIPPrefixID", + httpProxyConfig: { + serializedName: "properties.httpProxyConfig", type: { - name: "String" + name: "Composite", + className: "ManagedClusterHttpProxyConfig" } }, - scaleSetPriority: { - defaultValue: "Regular", - serializedName: "properties.scaleSetPriority", + securityProfile: { + serializedName: "properties.securityProfile", type: { - name: "String" + name: "Composite", + className: "ManagedClusterSecurityProfile" } }, - scaleSetEvictionPolicy: { - defaultValue: "Delete", - serializedName: "properties.scaleSetEvictionPolicy", + publicNetworkAccess: { + serializedName: "properties.publicNetworkAccess", type: { name: "String" } - }, - spotMaxPrice: { - defaultValue: -1, - serializedName: "properties.spotMaxPrice", - type: { - name: "Number" - } - }, - tags: { - serializedName: "properties.tags", + } + } + } +}; + +export const ManagedClusterAccessProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedClusterAccessProfile", + modelProperties: { + ...TrackedResource.type.modelProperties, + kubeConfig: { + serializedName: "properties.kubeConfig", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "ByteArray" } - }, - nodeLabels: { - serializedName: "properties.nodeLabels", + } + } + } +}; + +export const Snapshot: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Snapshot", + modelProperties: { + ...TrackedResource.type.modelProperties, + creationData: { + serializedName: "properties.creationData", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Composite", + className: "CreationData" } }, - nodeTaints: { - serializedName: "properties.nodeTaints", + snapshotType: { + defaultValue: "NodePool", + serializedName: "properties.snapshotType", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - proximityPlacementGroupID: { - serializedName: "properties.proximityPlacementGroupID", + kubernetesVersion: { + serializedName: "properties.kubernetesVersion", + readOnly: true, type: { name: "String" } }, - kubeletConfig: { - serializedName: "properties.kubeletConfig", + nodeImageVersion: { + serializedName: "properties.nodeImageVersion", + readOnly: true, type: { - name: "Composite", - className: "KubeletConfig" + name: "String" } }, - linuxOSConfig: { - serializedName: "properties.linuxOSConfig", + osType: { + defaultValue: "Linux", + serializedName: "properties.osType", + readOnly: true, type: { - name: "Composite", - className: "LinuxOSConfig" + name: "String" } }, - enableEncryptionAtHost: { - serializedName: "properties.enableEncryptionAtHost", + osSku: { + serializedName: "properties.osSku", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, - enableUltraSSD: { - serializedName: "properties.enableUltraSSD", + vmSize: { + serializedName: "properties.vmSize", + readOnly: true, type: { - name: "Boolean" + name: "String" } }, enableFips: { serializedName: "properties.enableFIPS", + readOnly: true, type: { name: "Boolean" } - }, - gpuInstanceProfile: { - serializedName: "properties.gpuInstanceProfile", - type: { - name: "String" - } - }, - creationData: { - serializedName: "properties.creationData", - type: { - name: "Composite", - className: "CreationData" - } } } } diff --git a/sdk/containerservice/arm-containerservice/src/models/parameters.ts b/sdk/containerservice/arm-containerservice/src/models/parameters.ts index c28a6033f4e2..e386a546621f 100644 --- a/sdk/containerservice/arm-containerservice/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservice/src/models/parameters.ts @@ -51,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-02-01", + defaultValue: "2022-03-01", isConstant: true, serializedName: "api-version", type: {