From 53d8f30e16fceb9720b90b3ef951e7a5650c89e7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 26 Aug 2022 18:44:25 +0000 Subject: [PATCH] CodeGen from PR 20171 in Azure/azure-rest-api-specs Merge e78085cd12418f89693e9741ea5d28359906146c into fa5e0d5aadf89873c365344c4723a6855080b0bc --- common/config/rush/pnpm-lock.yaml | 10 +- .../arm-containerservice/CHANGELOG.md | 68 +- .../arm-containerservice/_meta.json | 6 +- .../arm-containerservice/package.json | 14 +- .../review/arm-containerservice.api.md | 255 +------ .../src/containerServiceClient.ts | 51 +- .../arm-containerservice/src/models/index.ts | 377 ++-------- .../src/models/mappers.ts | 351 ++-------- .../src/models/parameters.ts | 74 +- .../src/operations/fleetMembers.ts | 486 ------------- .../src/operations/fleets.ts | 643 ------------------ .../src/operations/guardrailsVersions.ts | 72 ++ .../src/operations/index.ts | 3 +- .../src/operationsInterfaces/fleetMembers.ts | 113 --- .../src/operationsInterfaces/fleets.ts | 129 ---- .../guardrailsVersions.ts | 27 + .../src/operationsInterfaces/index.ts | 3 +- .../arm-containerservice/test/sampleTest.ts | 43 ++ .../arm-containerservice/tsconfig.json | 10 +- 19 files changed, 319 insertions(+), 2416 deletions(-) delete mode 100644 sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts delete mode 100644 sdk/containerservice/arm-containerservice/src/operations/fleets.ts create mode 100644 sdk/containerservice/arm-containerservice/src/operations/guardrailsVersions.ts delete mode 100644 sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleetMembers.ts delete mode 100644 sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleets.ts create mode 100644 sdk/containerservice/arm-containerservice/src/operationsInterfaces/guardrailsVersions.ts create mode 100644 sdk/containerservice/arm-containerservice/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index a8108e36afe0..93bef9b245d3 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4080,7 +4080,7 @@ packages: dependencies: semver: 7.3.7 shelljs: 0.8.5 - typescript: 4.9.0-dev.20220823 + typescript: 4.9.0-dev.20220825 dev: false /downlevel-dts/0.4.0: @@ -8991,8 +8991,8 @@ packages: hasBin: true dev: false - /typescript/4.9.0-dev.20220823: - resolution: {integrity: sha512-8LTaS3Uev9r3Mj6CzXIpr1KQdFD+98bM1Y/tuXUpKGoPWnplMoralGsxflIMa5l6O8P0NPqioDJDsxWeHsxA5A==} + /typescript/4.9.0-dev.20220825: + resolution: {integrity: sha512-X6bFdJycFPfp4CC8RqOZkCQauNIayamosrtovm6UlCjez9AKMQ1TQJiwReDybks9TGHR3LegEIvLIMWj+uiHYg==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -11150,7 +11150,7 @@ packages: dev: false file:projects/arm-containerservice-1.tgz: - resolution: {integrity: sha512-4rGEnPtnnvd6qO0J7GeggMeF9J4egZJXHQETtgzbj6rOZHNs0dTicn7Mj8QEAYM572CmGeh4D53ESDWzspHXFw==, tarball: file:projects/arm-containerservice-1.tgz} + resolution: {integrity: sha512-bcLRZG3rMY4v/pB1SJf+zmJnYONUusj0KIoHG97zYcu3icnX4f6saT1lnZJMOwioPSef0NRck4mtwK+RhgdzHg==, tarball: file:projects/arm-containerservice-1.tgz} name: '@rush-temp/arm-containerservice-1' version: 0.0.0 dependencies: @@ -11170,7 +11170,7 @@ packages: rollup: 2.77.2 rollup-plugin-sourcemaps: 0.6.3_rollup@2.77.2 tslib: 2.4.0 - typescript: 4.6.4 + typescript: 4.2.4 uglify-js: 3.16.3 transitivePeerDependencies: - '@types/node' diff --git a/sdk/containerservice/arm-containerservice/CHANGELOG.md b/sdk/containerservice/arm-containerservice/CHANGELOG.md index ba498bc2545a..817b72ef1bd4 100644 --- a/sdk/containerservice/arm-containerservice/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservice/CHANGELOG.md @@ -1,21 +1,10 @@ # Release History - -## 17.1.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 17.1.0-beta.2 (2022-08-19) + +## 17.1.0-beta.3 (2022-08-26) **Features** - - Added operation group FleetMembers - - Added operation group Fleets + - Added operation group GuardrailsVersions - Added operation group ManagedClusterSnapshots - Added operation group TrustedAccessRoleBindings - Added operation group TrustedAccessRoles @@ -24,32 +13,9 @@ - Added operation ManagedClusters.beginRotateServiceAccountSigningKeys - Added operation ManagedClusters.beginRotateServiceAccountSigningKeysAndWait - Added Interface AgentPoolsAbortLatestOperationOptionalParams - - Added Interface AzureEntityResource - - Added Interface ErrorAdditionalInfo - - Added Interface ErrorDetail - - Added Interface ErrorResponse - - Added Interface Fleet - - Added Interface FleetCredentialResult - - Added Interface FleetCredentialResults - - Added Interface FleetHubProfile - - Added Interface FleetListResult - - Added Interface FleetMember - - Added Interface FleetMembersCreateOrUpdateOptionalParams - - Added Interface FleetMembersDeleteOptionalParams - - Added Interface FleetMembersGetOptionalParams - - Added Interface FleetMembersListByFleetNextOptionalParams - - Added Interface FleetMembersListByFleetOptionalParams - - Added Interface FleetMembersListResult - - Added Interface FleetPatch - - Added Interface FleetsCreateOrUpdateOptionalParams - - Added Interface FleetsDeleteOptionalParams - - Added Interface FleetsGetOptionalParams - - Added Interface FleetsListByResourceGroupNextOptionalParams - - Added Interface FleetsListByResourceGroupOptionalParams - - Added Interface FleetsListCredentialsOptionalParams - - Added Interface FleetsListNextOptionalParams - - Added Interface FleetsListOptionalParams - - Added Interface FleetsUpdateOptionalParams + - Added Interface GuardrailsProfile + - Added Interface GuardrailsVersionsListOptionalParams + - Added Interface ListGuardrailsVersionsResponse - Added Interface ManagedClusterAzureMonitorProfile - Added Interface ManagedClusterAzureMonitorProfileKubeStateMetrics - Added Interface ManagedClusterAzureMonitorProfileMetrics @@ -90,20 +56,8 @@ - Added Interface TrustedAccessRolesListNextOptionalParams - Added Interface TrustedAccessRolesListOptionalParams - Added Type Alias ControlledValues - - Added Type Alias FleetMemberProvisioningState - - Added Type Alias FleetMembersCreateOrUpdateResponse - - Added Type Alias FleetMembersGetResponse - - Added Type Alias FleetMembersListByFleetNextResponse - - Added Type Alias FleetMembersListByFleetResponse - - Added Type Alias FleetProvisioningState - - Added Type Alias FleetsCreateOrUpdateResponse - - Added Type Alias FleetsGetResponse - - Added Type Alias FleetsListByResourceGroupNextResponse - - Added Type Alias FleetsListByResourceGroupResponse - - Added Type Alias FleetsListCredentialsResponse - - Added Type Alias FleetsListNextResponse - - Added Type Alias FleetsListResponse - - Added Type Alias FleetsUpdateResponse + - Added Type Alias GuardrailsVersionsListResponse + - Added Type Alias Level - Added Type Alias ManagedClusterSnapshotsCreateOrUpdateResponse - Added Type Alias ManagedClusterSnapshotsGetResponse - Added Type Alias ManagedClusterSnapshotsListByResourceGroupNextResponse @@ -143,14 +97,12 @@ - Interface ManagedClusterSecurityProfile has a new optional parameter workloadIdentity - Interface ManagedClusterStorageProfile has a new optional parameter blobCSIDriver - Interface ManagedClusterStorageProfileDiskCSIDriver has a new optional parameter version - - Class ContainerServiceClient has a new parameter fleetMembers - - Class ContainerServiceClient has a new parameter fleets + - Class ContainerServiceClient has a new parameter guardrailsVersions - Class ContainerServiceClient has a new parameter managedClusterSnapshots - Class ContainerServiceClient has a new parameter trustedAccessRoleBindings - Class ContainerServiceClient has a new parameter trustedAccessRoles - Added Enum KnownControlledValues - - Added Enum KnownFleetMemberProvisioningState - - Added Enum KnownFleetProvisioningState + - Added Enum KnownLevel - Added Enum KnownNetworkPluginMode - Added Enum KnownTrustedAccessRoleBindingProvisioningState - Added Enum KnownUpdateMode diff --git a/sdk/containerservice/arm-containerservice/_meta.json b/sdk/containerservice/arm-containerservice/_meta.json index 25024124bc2b..fc660e0f6991 100644 --- a/sdk/containerservice/arm-containerservice/_meta.json +++ b/sdk/containerservice/arm-containerservice/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c3753108541c27b2e5197651702837ec283d37ca", + "commit": "56dd7a25da810cec4b24e37bdab651e776319ea0", "readme": "specification/containerservice/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/containerservice/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "use": "@autorest/typescript@6.0.0-rc.1" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservice/package.json b/sdk/containerservice/arm-containerservice/package.json index 57a0df783654..45f93f0537e3 100644 --- a/sdk/containerservice/arm-containerservice/package.json +++ b/sdk/containerservice/arm-containerservice/package.json @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.2.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -109,13 +109,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerservice?view=azure-node-preview" - } -} + "autoPublish": true +} \ 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 6a3923871671..01710211a0ee 100644 --- a/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md +++ b/sdk/containerservice/arm-containerservice/review/arm-containerservice.api.md @@ -192,11 +192,6 @@ export interface AgentPoolUpgradeSettings { maxSurge?: string; } -// @public -export interface AzureEntityResource extends Resource { - readonly etag?: string; -} - // @public export interface AzureKeyVaultKms { enabled?: boolean; @@ -234,9 +229,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) - fleetMembers: FleetMembers; - // (undocumented) - fleets: Fleets; + guardrailsVersions: GuardrailsVersions; // (undocumented) maintenanceConfigurations: MaintenanceConfigurations; // (undocumented) @@ -371,26 +364,6 @@ export interface EndpointDetail { protocol?: string; } -// @public -export interface ErrorAdditionalInfo { - readonly info?: Record; - readonly type?: string; -} - -// @public -export interface ErrorDetail { - readonly additionalInfo?: ErrorAdditionalInfo[]; - readonly code?: string; - readonly details?: ErrorDetail[]; - readonly message?: string; - readonly target?: string; -} - -// @public -export interface ErrorResponse { - error?: ErrorDetail; -} - // @public export type Expander = string; @@ -404,197 +377,30 @@ export interface ExtendedLocation { export type ExtendedLocationTypes = string; // @public -export interface Fleet extends TrackedResource { - readonly etag?: string; - hubProfile?: FleetHubProfile; - readonly provisioningState?: FleetProvisioningState; -} - -// @public -export interface FleetCredentialResult { - readonly name?: string; - readonly value?: Uint8Array; -} - -// @public -export interface FleetCredentialResults { - readonly kubeconfigs?: FleetCredentialResult[]; -} - -// @public -export interface FleetHubProfile { - dnsPrefix?: string; - readonly fqdn?: string; - readonly kubernetesVersion?: string; -} - -// @public -export interface FleetListResult { - readonly nextLink?: string; - value?: Fleet[]; -} - -// @public -export interface FleetMember extends AzureEntityResource { - clusterResourceId?: string; - readonly provisioningState?: FleetMemberProvisioningState; -} - -// @public -export type FleetMemberProvisioningState = string; - -// @public -export interface FleetMembers { - beginCreateOrUpdate(resourceGroupName: string, fleetName: string, fleetMemberName: string, parameters: FleetMember, options?: FleetMembersCreateOrUpdateOptionalParams): Promise, FleetMembersCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, fleetName: string, fleetMemberName: string, parameters: FleetMember, options?: FleetMembersCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersDeleteOptionalParams): Promise; - get(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersGetOptionalParams): Promise; - listByFleet(resourceGroupName: string, fleetName: string, options?: FleetMembersListByFleetOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface FleetMembersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - ifNoneMatch?: string; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type FleetMembersCreateOrUpdateResponse = FleetMember; - -// @public -export interface FleetMembersDeleteOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface FleetMembersGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetMembersGetResponse = FleetMember; - -// @public -export interface FleetMembersListByFleetNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetMembersListByFleetNextResponse = FleetMembersListResult; - -// @public -export interface FleetMembersListByFleetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetMembersListByFleetResponse = FleetMembersListResult; - -// @public -export interface FleetMembersListResult { - readonly nextLink?: string; - value?: FleetMember[]; -} - -// @public -export interface FleetPatch { - tags?: { - [propertyName: string]: string; - }; -} - -// @public -export type FleetProvisioningState = string; - -// @public -export interface Fleets { - beginCreateOrUpdate(resourceGroupName: string, fleetName: string, parameters: Fleet, options?: FleetsCreateOrUpdateOptionalParams): Promise, FleetsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, fleetName: string, parameters: Fleet, options?: FleetsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, fleetName: string, options?: FleetsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, fleetName: string, options?: FleetsDeleteOptionalParams): Promise; - get(resourceGroupName: string, fleetName: string, options?: FleetsGetOptionalParams): Promise; - list(options?: FleetsListOptionalParams): PagedAsyncIterableIterator; - listByResourceGroup(resourceGroupName: string, options?: FleetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listCredentials(resourceGroupName: string, fleetName: string, options?: FleetsListCredentialsOptionalParams): Promise; - update(resourceGroupName: string, fleetName: string, options?: FleetsUpdateOptionalParams): Promise; -} - -// @public -export interface FleetsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - ifNoneMatch?: string; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type FleetsCreateOrUpdateResponse = Fleet; - -// @public -export interface FleetsDeleteOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export interface FleetsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetsGetResponse = Fleet; - -// @public -export interface FleetsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetsListByResourceGroupNextResponse = FleetListResult; - -// @public -export interface FleetsListByResourceGroupOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FleetsListByResourceGroupResponse = FleetListResult; - -// @public -export interface FleetsListCredentialsOptionalParams extends coreClient.OperationOptions { -} +export type Format = string; // @public -export type FleetsListCredentialsResponse = FleetCredentialResults; +export type GPUInstanceProfile = string; // @public -export interface FleetsListNextOptionalParams extends coreClient.OperationOptions { +export interface GuardrailsProfile { + excludedNamespaces?: string[]; + level: Level; + readonly systemExcludedNamespaces?: string[]; + version: string; } // @public -export type FleetsListNextResponse = FleetListResult; - -// @public -export interface FleetsListOptionalParams extends coreClient.OperationOptions { +export interface GuardrailsVersions { + list(resourceGroupName: string, resourceName: string, options?: GuardrailsVersionsListOptionalParams): Promise; } // @public -export type FleetsListResponse = FleetListResult; - -// @public -export interface FleetsUpdateOptionalParams extends coreClient.OperationOptions { - ifMatch?: string; - parameters?: FleetPatch; +export interface GuardrailsVersionsListOptionalParams extends coreClient.OperationOptions { } // @public -export type FleetsUpdateResponse = Fleet; - -// @public -export type Format = string; - -// @public -export type GPUInstanceProfile = string; +export type GuardrailsVersionsListResponse = ListGuardrailsVersionsResponse; // @public export type IpFamily = string; @@ -839,26 +645,6 @@ export enum KnownExtendedLocationTypes { EdgeZone = "EdgeZone" } -// @public -export enum KnownFleetMemberProvisioningState { - Canceled = "Canceled", - Failed = "Failed", - Joining = "Joining", - Leaving = "Leaving", - Succeeded = "Succeeded", - Updating = "Updating" -} - -// @public -export enum KnownFleetProvisioningState { - Canceled = "Canceled", - Creating = "Creating", - Deleting = "Deleting", - Failed = "Failed", - Succeeded = "Succeeded", - Updating = "Updating" -} - // @public export enum KnownFormat { Azure = "azure", @@ -892,6 +678,13 @@ export enum KnownKubeletDiskType { Temporary = "Temporary" } +// @public +export enum KnownLevel { + Enforcement = "Enforcement", + Off = "Off", + Warning = "Warning" +} + // @public export enum KnownLicenseType { None = "None", @@ -1074,6 +867,9 @@ export interface KubeletConfig { // @public export type KubeletDiskType = string; +// @public +export type Level = string; + // @public export type LicenseType = string; @@ -1085,6 +881,13 @@ export interface LinuxOSConfig { transparentHugePageEnabled?: string; } +// @public (undocumented) +export interface ListGuardrailsVersionsResponse { + default?: boolean; + isPreview?: boolean; + readonly version?: string; +} + // @public export type LoadBalancerSku = string; diff --git a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts index d61989100bf5..d3cf445c4b31 100644 --- a/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts +++ b/sdk/containerservice/arm-containerservice/src/containerServiceClient.ts @@ -26,8 +26,7 @@ import { ManagedClusterSnapshotsImpl, TrustedAccessRolesImpl, TrustedAccessRoleBindingsImpl, - FleetsImpl, - FleetMembersImpl + GuardrailsVersionsImpl } from "./operations"; import { Operations, @@ -41,8 +40,7 @@ import { ManagedClusterSnapshots, TrustedAccessRoles, TrustedAccessRoleBindings, - Fleets, - FleetMembers + GuardrailsVersions } from "./operationsInterfaces"; import { ContainerServiceClientOptionalParams } from "./models"; @@ -98,41 +96,34 @@ export class ContainerServiceClient extends coreClient.ServiceClient { }; super(optionsWithDefaults); - let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( + const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) - ); + 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-07-02-preview"; + this.apiVersion = options.apiVersion || "2022-08-02-preview"; this.operations = new OperationsImpl(this); this.managedClusters = new ManagedClustersImpl(this); this.maintenanceConfigurations = new MaintenanceConfigurationsImpl(this); @@ -146,8 +137,7 @@ export class ContainerServiceClient extends coreClient.ServiceClient { this.managedClusterSnapshots = new ManagedClusterSnapshotsImpl(this); this.trustedAccessRoles = new TrustedAccessRolesImpl(this); this.trustedAccessRoleBindings = new TrustedAccessRoleBindingsImpl(this); - this.fleets = new FleetsImpl(this); - this.fleetMembers = new FleetMembersImpl(this); + this.guardrailsVersions = new GuardrailsVersionsImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -190,6 +180,5 @@ export class ContainerServiceClient extends coreClient.ServiceClient { managedClusterSnapshots: ManagedClusterSnapshots; trustedAccessRoles: TrustedAccessRoles; trustedAccessRoleBindings: TrustedAccessRoleBindings; - fleets: Fleets; - fleetMembers: FleetMembers; + guardrailsVersions: GuardrailsVersions; } diff --git a/sdk/containerservice/arm-containerservice/src/models/index.ts b/sdk/containerservice/arm-containerservice/src/models/index.ts index 1f86b9933f3b..f805afb491e8 100644 --- a/sdk/containerservice/arm-containerservice/src/models/index.ts +++ b/sdk/containerservice/arm-containerservice/src/models/index.ts @@ -1389,120 +1389,13 @@ export interface TrustedAccessRoleBindingListResult { readonly nextLink?: string; } -/** The FleetHubProfile configures the fleet hub. */ -export interface FleetHubProfile { - /** DNS prefix used to create the FQDN for the Fleet hub. */ - dnsPrefix?: string; - /** - * The FQDN of the Fleet hub. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly fqdn?: string; - /** - * The Kubernetes version of the Fleet hub. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly kubernetesVersion?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** Properties of a Fleet that can be patched. */ -export interface FleetPatch { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; -} - -/** The response from the List Fleets operation. */ -export interface FleetListResult { - /** The list of Fleets. */ - value?: Fleet[]; - /** - * The URL to get the next page of Fleets. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** The response from the List FleetMembers operation. */ -export interface FleetMembersListResult { - /** The list of members in a given Fleet. */ - value?: FleetMember[]; - /** - * The URL to get the next page of Fleet members. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** The list credential result response. */ -export interface FleetCredentialResults { - /** - * Base64-encoded Kubernetes configuration file. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly kubeconfigs?: FleetCredentialResult[]; -} - -/** The credential result response. */ -export interface FleetCredentialResult { - /** - * The name of the credential. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Base64-encoded Kubernetes configuration file. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly value?: Uint8Array; +export interface ListGuardrailsVersionsResponse { + /** NOTE: This property will not be serialized. It can only be populated by the server. */ + readonly version?: string; + /** Describes whether this version is in preview */ + isPreview?: boolean; + /** Describes whether this version is default */ + default?: boolean; } /** Profile for the container service master. */ @@ -1545,6 +1438,21 @@ export interface ContainerServiceVMDiagnostics { readonly storageUri?: string; } +/** The Guardrails profile. */ +export interface GuardrailsProfile { + /** + * List of namespaces specified by AKS to be excluded from Guardrails + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemExcludedNamespaces?: string[]; + /** The version of constraints to use */ + version: string; + /** The guardrails level to be used. By default, Guardrails is enabled for all namespaces except those that AKS excludes via systemExcludedNamespaces */ + level: Level; + /** List of namespaces excluded from guardrails checks */ + excludedNamespaces?: string[]; +} + /** Profile for the container service agent pool. */ export interface ManagedClusterAgentPoolProfile extends ManagedClusterAgentPoolProfileProperties { @@ -1577,15 +1485,6 @@ export interface TrustedAccessRoleBinding extends Resource { roles: string[]; } -/** The resource model definition for an Azure Resource Manager resource with an etag. */ -export interface AzureEntityResource extends Resource { - /** - * Resource Etag. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; -} - /** See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance. */ export interface MaintenanceConfiguration extends SubResource { /** @@ -1864,33 +1763,6 @@ export interface ManagedClusterSnapshot extends TrackedResource { readonly managedClusterPropertiesReadOnly?: ManagedClusterPropertiesForSnapshot; } -/** The Fleet resource which contains multiple Kubernetes clusters as its members. */ -export interface Fleet extends TrackedResource { - /** - * Resource Etag. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly etag?: string; - /** The FleetHubProfile configures the Fleet's hub. */ - hubProfile?: FleetHubProfile; - /** - * The provisioning state of the last accepted operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: FleetProvisioningState; -} - -/** A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. */ -export interface FleetMember extends AzureEntityResource { - /** The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'. */ - clusterResourceId?: string; - /** - * The provisioning state of the last accepted operation. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: FleetMemberProvisioningState; -} - /** Defines headers for AgentPools_upgradeNodeImageVersion operation. */ export interface AgentPoolsUpgradeNodeImageVersionHeaders { /** URL to query for status of the operation. */ @@ -2647,66 +2519,6 @@ export enum KnownTrustedAccessRoleBindingProvisioningState { */ export type TrustedAccessRoleBindingProvisioningState = string; -/** Known values of {@link FleetProvisioningState} that the service accepts. */ -export enum KnownFleetProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Updating */ - Updating = "Updating" -} - -/** - * Defines values for FleetProvisioningState. \ - * {@link KnownFleetProvisioningState} can be used interchangeably with FleetProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Creating** \ - * **Deleting** \ - * **Updating** - */ -export type FleetProvisioningState = string; - -/** Known values of {@link FleetMemberProvisioningState} that the service accepts. */ -export enum KnownFleetMemberProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Failed */ - Failed = "Failed", - /** Canceled */ - Canceled = "Canceled", - /** Joining */ - Joining = "Joining", - /** Leaving */ - Leaving = "Leaving", - /** Updating */ - Updating = "Updating" -} - -/** - * Defines values for FleetMemberProvisioningState. \ - * {@link KnownFleetMemberProvisioningState} can be used interchangeably with FleetMemberProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Failed** \ - * **Canceled** \ - * **Joining** \ - * **Leaving** \ - * **Updating** - */ -export type FleetMemberProvisioningState = string; - /** Known values of {@link ContainerServiceVMSizeTypes} that the service accepts. */ export enum KnownContainerServiceVMSizeTypes { /** StandardA1 */ @@ -3258,6 +3070,27 @@ export enum KnownContainerServiceStorageProfileTypes { * **ManagedDisks** */ export type ContainerServiceStorageProfileTypes = string; + +/** Known values of {@link Level} that the service accepts. */ +export enum KnownLevel { + /** Off */ + Off = "Off", + /** Warning */ + Warning = "Warning", + /** Enforcement */ + Enforcement = "Enforcement" +} + +/** + * Defines values for Level. \ + * {@link KnownLevel} can be used interchangeably with Level, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Off** \ + * **Warning** \ + * **Enforcement** + */ +export type Level = string; /** Defines values for ResourceIdentityType. */ export type ResourceIdentityType = "SystemAssigned" | "UserAssigned" | "None"; /** Defines values for Count. */ @@ -3787,131 +3620,11 @@ export interface TrustedAccessRoleBindingsListNextOptionalParams export type TrustedAccessRoleBindingsListNextResponse = TrustedAccessRoleBindingListResult; /** Optional parameters. */ -export interface FleetsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new resource to be created and prevent updating an existing resource. Other values will result in a 412 Pre-condition Failed response. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type FleetsCreateOrUpdateResponse = Fleet; - -/** Optional parameters. */ -export interface FleetsUpdateOptionalParams - extends coreClient.OperationOptions { - /** Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** The properties of a Fleet to update. */ - parameters?: FleetPatch; -} - -/** Contains response data for the update operation. */ -export type FleetsUpdateResponse = Fleet; - -/** Optional parameters. */ -export interface FleetsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type FleetsGetResponse = Fleet; - -/** Optional parameters. */ -export interface FleetsDeleteOptionalParams - extends coreClient.OperationOptions { - /** Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface FleetsListByResourceGroupOptionalParams +export interface GuardrailsVersionsListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listByResourceGroup operation. */ -export type FleetsListByResourceGroupResponse = FleetListResult; - -/** Optional parameters. */ -export interface FleetsListOptionalParams extends coreClient.OperationOptions {} - /** Contains response data for the list operation. */ -export type FleetsListResponse = FleetListResult; - -/** Optional parameters. */ -export interface FleetsListCredentialsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listCredentials operation. */ -export type FleetsListCredentialsResponse = FleetCredentialResults; - -/** Optional parameters. */ -export interface FleetsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type FleetsListByResourceGroupNextResponse = FleetListResult; - -/** Optional parameters. */ -export interface FleetsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type FleetsListNextResponse = FleetListResult; - -/** Optional parameters. */ -export interface FleetMembersCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Set to '*' to allow a new resource to be created and prevent updating an existing resource. Other values will result in a 412 Pre-condition Failed response. */ - ifNoneMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type FleetMembersCreateOrUpdateResponse = FleetMember; - -/** Optional parameters. */ -export interface FleetMembersGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type FleetMembersGetResponse = FleetMember; - -/** Optional parameters. */ -export interface FleetMembersDeleteOptionalParams - extends coreClient.OperationOptions { - /** Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes. */ - ifMatch?: string; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface FleetMembersListByFleetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByFleet operation. */ -export type FleetMembersListByFleetResponse = FleetMembersListResult; - -/** Optional parameters. */ -export interface FleetMembersListByFleetNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByFleetNext operation. */ -export type FleetMembersListByFleetNextResponse = FleetMembersListResult; +export type GuardrailsVersionsListResponse = ListGuardrailsVersionsResponse; /** Optional parameters. */ export interface ContainerServiceClientOptionalParams diff --git a/sdk/containerservice/arm-containerservice/src/models/mappers.ts b/sdk/containerservice/arm-containerservice/src/models/mappers.ts index da3a6b8bdf7e..089efda17c7f 100644 --- a/sdk/containerservice/arm-containerservice/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservice/src/models/mappers.ts @@ -3715,242 +3715,28 @@ export const TrustedAccessRoleBindingListResult: coreClient.CompositeMapper = { } }; -export const FleetHubProfile: coreClient.CompositeMapper = { +export const ListGuardrailsVersionsResponse: coreClient.CompositeMapper = { type: { name: "Composite", - className: "FleetHubProfile", + className: "ListGuardrailsVersionsResponse", modelProperties: { - dnsPrefix: { - serializedName: "dnsPrefix", - type: { - name: "String" - } - }, - fqdn: { - serializedName: "fqdn", - readOnly: true, - type: { - name: "String" - } - }, - kubernetesVersion: { - serializedName: "kubernetesVersion", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - } -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String" - } - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String" - } - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String" - } - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail" - } - } - } - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String" - } - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } -}; - -export const FleetPatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetPatch", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } -}; - -export const FleetListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Fleet" - } - } - } - }, - nextLink: { - serializedName: "nextLink", + version: { + serializedName: "version", readOnly: true, type: { name: "String" } - } - } - } -}; - -export const FleetMembersListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetMembersListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FleetMember" - } - } - } }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const FleetCredentialResults: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetCredentialResults", - modelProperties: { - kubeconfigs: { - serializedName: "kubeconfigs", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FleetCredentialResult" - } - } - } - } - } - } -}; - -export const FleetCredentialResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetCredentialResult", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, + isPreview: { + serializedName: "isPreview", type: { - name: "String" + name: "Boolean" } }, - value: { - serializedName: "value", - readOnly: true, + default: { + serializedName: "default", type: { - name: "ByteArray" + name: "Boolean" } } } @@ -4063,6 +3849,52 @@ export const ContainerServiceVMDiagnostics: coreClient.CompositeMapper = { } }; +export const GuardrailsProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GuardrailsProfile", + modelProperties: { + systemExcludedNamespaces: { + serializedName: "systemExcludedNamespaces", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + version: { + serializedName: "version", + required: true, + type: { + name: "String" + } + }, + level: { + serializedName: "level", + required: true, + type: { + name: "String" + } + }, + excludedNamespaces: { + serializedName: "excludedNamespaces", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + export const ManagedClusterAgentPoolProfile: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4153,23 +3985,6 @@ export const TrustedAccessRoleBinding: coreClient.CompositeMapper = { } }; -export const AzureEntityResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AzureEntityResource", - modelProperties: { - ...Resource.type.modelProperties, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const MaintenanceConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4928,60 +4743,6 @@ export const ManagedClusterSnapshot: coreClient.CompositeMapper = { } }; -export const Fleet: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Fleet", - modelProperties: { - ...TrackedResource.type.modelProperties, - etag: { - serializedName: "etag", - readOnly: true, - type: { - name: "String" - } - }, - hubProfile: { - serializedName: "properties.hubProfile", - type: { - name: "Composite", - className: "FleetHubProfile" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - -export const FleetMember: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FleetMember", - modelProperties: { - ...AzureEntityResource.type.modelProperties, - clusterResourceId: { - serializedName: "properties.clusterResourceId", - type: { - name: "String" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const AgentPoolsUpgradeNodeImageVersionHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/containerservice/arm-containerservice/src/models/parameters.ts b/sdk/containerservice/arm-containerservice/src/models/parameters.ts index 95d5cdb6fa82..dea6b0bcb2da 100644 --- a/sdk/containerservice/arm-containerservice/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservice/src/models/parameters.ts @@ -23,10 +23,7 @@ import { PrivateLinkResource as PrivateLinkResourceMapper, Snapshot as SnapshotMapper, ManagedClusterSnapshot as ManagedClusterSnapshotMapper, - TrustedAccessRoleBinding as TrustedAccessRoleBindingMapper, - Fleet as FleetMapper, - FleetPatch as FleetPatchMapper, - FleetMember as FleetMemberMapper + TrustedAccessRoleBinding as TrustedAccessRoleBindingMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -56,7 +53,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-07-02-preview", + defaultValue: "2022-08-02-preview", isConstant: true, serializedName: "api-version", type: { @@ -319,70 +316,3 @@ export const trustedAccessRoleBinding: OperationParameter = { parameterPath: "trustedAccessRoleBinding", mapper: TrustedAccessRoleBindingMapper }; - -export const parameters10: OperationParameter = { - parameterPath: "parameters", - mapper: FleetMapper -}; - -export const fleetName: OperationURLParameter = { - parameterPath: "fleetName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"), - MaxLength: 63, - MinLength: 1 - }, - serializedName: "fleetName", - required: true, - type: { - name: "String" - } - } -}; - -export const ifMatch: OperationParameter = { - parameterPath: ["options", "ifMatch"], - mapper: { - serializedName: "If-Match", - type: { - name: "String" - } - } -}; - -export const ifNoneMatch: OperationParameter = { - parameterPath: ["options", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - type: { - name: "String" - } - } -}; - -export const parameters11: OperationParameter = { - parameterPath: ["options", "parameters"], - mapper: FleetPatchMapper -}; - -export const parameters12: OperationParameter = { - parameterPath: "parameters", - mapper: FleetMemberMapper -}; - -export const fleetMemberName: OperationURLParameter = { - parameterPath: "fleetMemberName", - mapper: { - constraints: { - Pattern: new RegExp("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"), - MaxLength: 50, - MinLength: 1 - }, - serializedName: "fleetMemberName", - required: true, - type: { - name: "String" - } - } -}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts b/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts deleted file mode 100644 index fcd190385b25..000000000000 --- a/sdk/containerservice/arm-containerservice/src/operations/fleetMembers.ts +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { FleetMembers } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ContainerServiceClient } from "../containerServiceClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - FleetMember, - FleetMembersListByFleetNextOptionalParams, - FleetMembersListByFleetOptionalParams, - FleetMembersCreateOrUpdateOptionalParams, - FleetMembersCreateOrUpdateResponse, - FleetMembersGetOptionalParams, - FleetMembersGetResponse, - FleetMembersDeleteOptionalParams, - FleetMembersListByFleetResponse, - FleetMembersListByFleetNextResponse -} from "../models"; - -/// -/** Class containing FleetMembers operations. */ -export class FleetMembersImpl implements FleetMembers { - private readonly client: ContainerServiceClient; - - /** - * Initialize a new instance of the class FleetMembers class. - * @param client Reference to the service client - */ - constructor(client: ContainerServiceClient) { - this.client = client; - } - - /** - * Lists the members of a fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - public listByFleet( - resourceGroupName: string, - fleetName: string, - options?: FleetMembersListByFleetOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByFleetPagingAll( - resourceGroupName, - fleetName, - options - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listByFleetPagingPage( - resourceGroupName, - fleetName, - options - ); - } - }; - } - - private async *listByFleetPagingPage( - resourceGroupName: string, - fleetName: string, - options?: FleetMembersListByFleetOptionalParams - ): AsyncIterableIterator { - let result = await this._listByFleet(resourceGroupName, fleetName, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listByFleetNext( - resourceGroupName, - fleetName, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listByFleetPagingAll( - resourceGroupName: string, - fleetName: string, - options?: FleetMembersListByFleetOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByFleetPagingPage( - resourceGroupName, - fleetName, - options - )) { - yield* page; - } - } - - /** - * A member contains a reference to an existing Kubernetes cluster. Creating a member makes the - * referenced cluster join the Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param parameters The Fleet member to create or update. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - parameters: FleetMember, - options?: FleetMembersCreateOrUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - FleetMembersCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceGroupName, fleetName, fleetMemberName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * A member contains a reference to an existing Kubernetes cluster. Creating a member makes the - * referenced cluster join the Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param parameters The Fleet member to create or update. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - parameters: FleetMember, - options?: FleetMembersCreateOrUpdateOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - fleetName, - fleetMemberName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Gets a Fleet member. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, fleetMemberName, options }, - getOperationSpec - ); - } - - /** - * Deleting a Fleet member results in the member cluster leaving fleet. The Member azure resource is - * deleted upon success. The underlying cluster is not deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersDeleteOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceGroupName, fleetName, fleetMemberName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Deleting a Fleet member results in the member cluster leaving fleet. The Member azure resource is - * deleted upon success. The underlying cluster is not deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersDeleteOptionalParams - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - fleetName, - fleetMemberName, - options - ); - return poller.pollUntilDone(); - } - - /** - * Lists the members of a fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - private _listByFleet( - resourceGroupName: string, - fleetName: string, - options?: FleetMembersListByFleetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, options }, - listByFleetOperationSpec - ); - } - - /** - * ListByFleetNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param nextLink The nextLink from the previous successful call to the ListByFleet method. - * @param options The options parameters. - */ - private _listByFleetNext( - resourceGroupName: string, - fleetName: string, - nextLink: string, - options?: FleetMembersListByFleetNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, nextLink, options }, - listByFleetNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.FleetMember - }, - 201: { - bodyMapper: Mappers.FleetMember - }, - 202: { - bodyMapper: Mappers.FleetMember - }, - 204: { - bodyMapper: Mappers.FleetMember - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters12, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName, - Parameters.fleetMemberName - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch - ], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetMember - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName, - Parameters.fleetMemberName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members/{fleetMemberName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName, - Parameters.fleetMemberName - ], - headerParameters: [Parameters.accept, Parameters.ifMatch], - serializer -}; -const listByFleetOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/members", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetMembersListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByFleetNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetMembersListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink, - Parameters.fleetName - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/fleets.ts b/sdk/containerservice/arm-containerservice/src/operations/fleets.ts deleted file mode 100644 index 99a904618257..000000000000 --- a/sdk/containerservice/arm-containerservice/src/operations/fleets.ts +++ /dev/null @@ -1,643 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Fleets } from "../operationsInterfaces"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers"; -import * as Parameters from "../models/parameters"; -import { ContainerServiceClient } from "../containerServiceClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; -import { - Fleet, - FleetsListByResourceGroupNextOptionalParams, - FleetsListByResourceGroupOptionalParams, - FleetsListNextOptionalParams, - FleetsListOptionalParams, - FleetsCreateOrUpdateOptionalParams, - FleetsCreateOrUpdateResponse, - FleetsUpdateOptionalParams, - FleetsUpdateResponse, - FleetsGetOptionalParams, - FleetsGetResponse, - FleetsDeleteOptionalParams, - FleetsListByResourceGroupResponse, - FleetsListResponse, - FleetsListCredentialsOptionalParams, - FleetsListCredentialsResponse, - FleetsListByResourceGroupNextResponse, - FleetsListNextResponse -} from "../models"; - -/// -/** Class containing Fleets operations. */ -export class FleetsImpl implements Fleets { - private readonly client: ContainerServiceClient; - - /** - * Initialize a new instance of the class Fleets class. - * @param client Reference to the service client - */ - constructor(client: ContainerServiceClient) { - this.client = client; - } - - /** - * Lists fleets in the specified subscription and resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); - } - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options - ); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options - )) { - yield* page; - } - } - - /** - * Lists fleets in the specified subscription. - * @param options The options parameters. - */ - public list( - options?: FleetsListOptionalParams - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: () => { - return this.listPagingPage(options); - } - }; - } - - private async *listPagingPage( - options?: FleetsListOptionalParams - ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - yield result.value || []; - } - } - - private async *listPagingAll( - options?: FleetsListOptionalParams - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Creates or updates a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param parameters The Fleet to create or update. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - resourceGroupName: string, - fleetName: string, - parameters: Fleet, - options?: FleetsCreateOrUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - FleetsCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceGroupName, fleetName, parameters, options }, - createOrUpdateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs - }); - await poller.poll(); - return poller; - } - - /** - * Creates or updates a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param parameters The Fleet to create or update. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - resourceGroupName: string, - fleetName: string, - parameters: Fleet, - options?: FleetsCreateOrUpdateOptionalParams - ): Promise { - const poller = await this.beginCreateOrUpdate( - resourceGroupName, - fleetName, - parameters, - options - ); - return poller.pollUntilDone(); - } - - /** - * Patches a fleet resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - fleetName: string, - options?: FleetsUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, options }, - updateOperationSpec - ); - } - - /** - * Gets a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - fleetName: string, - options?: FleetsGetOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, options }, - getOperationSpec - ); - } - - /** - * Deletes a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - fleetName: string, - options?: FleetsDeleteOptionalParams - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback - } - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } - }; - }; - - const lro = new LroImpl( - sendOperation, - { resourceGroupName, fleetName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "location" - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - fleetName: string, - options?: FleetsDeleteOptionalParams - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - fleetName, - options - ); - return poller.pollUntilDone(); - } - - /** - * Lists fleets in the specified subscription and resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec - ); - } - - /** - * Lists fleets in the specified subscription. - * @param options The options parameters. - */ - private _list( - options?: FleetsListOptionalParams - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * Lists the user credentials of a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - listCredentials( - resourceGroupName: string, - fleetName: string, - options?: FleetsListCredentialsOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, options }, - listCredentialsOperationSpec - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: FleetsListByResourceGroupNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec - ); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: FleetsListNextOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.Fleet - }, - 201: { - bodyMapper: Mappers.Fleet - }, - 202: { - bodyMapper: Mappers.Fleet - }, - 204: { - bodyMapper: Mappers.Fleet - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch, - Parameters.ifNoneMatch - ], - mediaType: "json", - serializer -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.Fleet - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - requestBody: Parameters.parameters11, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [ - Parameters.accept, - Parameters.contentType, - Parameters.ifMatch - ], - mediaType: "json", - serializer -}; -const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.Fleet - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [Parameters.accept], - serializer -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [Parameters.accept, Parameters.ifMatch], - serializer -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/fleets", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer -}; -const listCredentialsOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/listCredentials", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.FleetCredentialResults - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.fleetName - ], - headerParameters: [Parameters.accept], - serializer -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.FleetListResult - }, - default: { - bodyMapper: Mappers.ErrorResponse - } - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.nextLink - ], - headerParameters: [Parameters.accept], - serializer -}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/guardrailsVersions.ts b/sdk/containerservice/arm-containerservice/src/operations/guardrailsVersions.ts new file mode 100644 index 000000000000..c4a736b34c70 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/src/operations/guardrailsVersions.ts @@ -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. + */ + +import { GuardrailsVersions } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerServiceClient } from "../containerServiceClient"; +import { + GuardrailsVersionsListOptionalParams, + GuardrailsVersionsListResponse +} from "../models"; + +/** Class containing GuardrailsVersions operations. */ +export class GuardrailsVersionsImpl implements GuardrailsVersions { + private readonly client: ContainerServiceClient; + + /** + * Initialize a new instance of the class GuardrailsVersions class. + * @param client Reference to the service client + */ + constructor(client: ContainerServiceClient) { + this.client = client; + } + + /** + * List available guardrails versions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: GuardrailsVersionsListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, resourceName, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/guardrailsversions", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListGuardrailsVersionsResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.resourceName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/containerservice/arm-containerservice/src/operations/index.ts b/sdk/containerservice/arm-containerservice/src/operations/index.ts index e45d9b4f3499..108d6222a4c7 100644 --- a/sdk/containerservice/arm-containerservice/src/operations/index.ts +++ b/sdk/containerservice/arm-containerservice/src/operations/index.ts @@ -17,5 +17,4 @@ export * from "./snapshots"; export * from "./managedClusterSnapshots"; export * from "./trustedAccessRoles"; export * from "./trustedAccessRoleBindings"; -export * from "./fleets"; -export * from "./fleetMembers"; +export * from "./guardrailsVersions"; diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleetMembers.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleetMembers.ts deleted file mode 100644 index 8f6f197a37df..000000000000 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleetMembers.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { - FleetMember, - FleetMembersListByFleetOptionalParams, - FleetMembersCreateOrUpdateOptionalParams, - FleetMembersCreateOrUpdateResponse, - FleetMembersGetOptionalParams, - FleetMembersGetResponse, - FleetMembersDeleteOptionalParams -} from "../models"; - -/// -/** Interface representing a FleetMembers. */ -export interface FleetMembers { - /** - * Lists the members of a fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - listByFleet( - resourceGroupName: string, - fleetName: string, - options?: FleetMembersListByFleetOptionalParams - ): PagedAsyncIterableIterator; - /** - * A member contains a reference to an existing Kubernetes cluster. Creating a member makes the - * referenced cluster join the Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param parameters The Fleet member to create or update. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - parameters: FleetMember, - options?: FleetMembersCreateOrUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - FleetMembersCreateOrUpdateResponse - > - >; - /** - * A member contains a reference to an existing Kubernetes cluster. Creating a member makes the - * referenced cluster join the Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param parameters The Fleet member to create or update. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - parameters: FleetMember, - options?: FleetMembersCreateOrUpdateOptionalParams - ): Promise; - /** - * Gets a Fleet member. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersGetOptionalParams - ): Promise; - /** - * Deleting a Fleet member results in the member cluster leaving fleet. The Member azure resource is - * deleted upon success. The underlying cluster is not deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersDeleteOptionalParams - ): Promise, void>>; - /** - * Deleting a Fleet member results in the member cluster leaving fleet. The Member azure resource is - * deleted upon success. The underlying cluster is not deleted. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param fleetMemberName The name of the Fleet member resource. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - fleetName: string, - fleetMemberName: string, - options?: FleetMembersDeleteOptionalParams - ): Promise; -} diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleets.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleets.ts deleted file mode 100644 index 1dcc3e16d08d..000000000000 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/fleets.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; -import { - Fleet, - FleetsListByResourceGroupOptionalParams, - FleetsListOptionalParams, - FleetsCreateOrUpdateOptionalParams, - FleetsCreateOrUpdateResponse, - FleetsUpdateOptionalParams, - FleetsUpdateResponse, - FleetsGetOptionalParams, - FleetsGetResponse, - FleetsDeleteOptionalParams, - FleetsListCredentialsOptionalParams, - FleetsListCredentialsResponse -} from "../models"; - -/// -/** Interface representing a Fleets. */ -export interface Fleets { - /** - * Lists fleets in the specified subscription and resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: FleetsListByResourceGroupOptionalParams - ): PagedAsyncIterableIterator; - /** - * Lists fleets in the specified subscription. - * @param options The options parameters. - */ - list(options?: FleetsListOptionalParams): PagedAsyncIterableIterator; - /** - * Creates or updates a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param parameters The Fleet to create or update. - * @param options The options parameters. - */ - beginCreateOrUpdate( - resourceGroupName: string, - fleetName: string, - parameters: Fleet, - options?: FleetsCreateOrUpdateOptionalParams - ): Promise< - PollerLike< - PollOperationState, - FleetsCreateOrUpdateResponse - > - >; - /** - * Creates or updates a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param parameters The Fleet to create or update. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - resourceGroupName: string, - fleetName: string, - parameters: Fleet, - options?: FleetsCreateOrUpdateOptionalParams - ): Promise; - /** - * Patches a fleet resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - update( - resourceGroupName: string, - fleetName: string, - options?: FleetsUpdateOptionalParams - ): Promise; - /** - * Gets a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - fleetName: string, - options?: FleetsGetOptionalParams - ): Promise; - /** - * Deletes a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - fleetName: string, - options?: FleetsDeleteOptionalParams - ): Promise, void>>; - /** - * Deletes a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - fleetName: string, - options?: FleetsDeleteOptionalParams - ): Promise; - /** - * Lists the user credentials of a Fleet. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName The name of the Fleet resource. - * @param options The options parameters. - */ - listCredentials( - resourceGroupName: string, - fleetName: string, - options?: FleetsListCredentialsOptionalParams - ): Promise; -} diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/guardrailsVersions.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/guardrailsVersions.ts new file mode 100644 index 000000000000..b9519b146b43 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/guardrailsVersions.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + GuardrailsVersionsListOptionalParams, + GuardrailsVersionsListResponse +} from "../models"; + +/** Interface representing a GuardrailsVersions. */ +export interface GuardrailsVersions { + /** + * List available guardrails versions. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the managed cluster resource. + * @param options The options parameters. + */ + list( + resourceGroupName: string, + resourceName: string, + options?: GuardrailsVersionsListOptionalParams + ): Promise; +} diff --git a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts index e45d9b4f3499..108d6222a4c7 100644 --- a/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts +++ b/sdk/containerservice/arm-containerservice/src/operationsInterfaces/index.ts @@ -17,5 +17,4 @@ export * from "./snapshots"; export * from "./managedClusterSnapshots"; export * from "./trustedAccessRoles"; export * from "./trustedAccessRoleBindings"; -export * from "./fleets"; -export * from "./fleetMembers"; +export * from "./guardrailsVersions"; diff --git a/sdk/containerservice/arm-containerservice/test/sampleTest.ts b/sdk/containerservice/arm-containerservice/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/containerservice/arm-containerservice/test/sampleTest.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. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/containerservice/arm-containerservice/tsconfig.json b/sdk/containerservice/arm-containerservice/tsconfig.json index 5bad5556bbfd..3e6ae96443f3 100644 --- a/sdk/containerservice/arm-containerservice/tsconfig.json +++ b/sdk/containerservice/arm-containerservice/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-containerservice": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"