diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c67a7a58822f..65ec346af991 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -10505,6 +10505,37 @@ packages: yn: 3.1.1 dev: false + /ts-node@10.9.2(@types/node@18.19.50)(typescript@5.5.4): + resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 18.19.50 + acorn: 8.12.1 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.5.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: false + /ts-node@10.9.2(@types/node@18.19.50)(typescript@5.6.2): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -10744,6 +10775,12 @@ packages: hasBin: true dev: false + /typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + engines: {node: '>=14.17'} + hasBin: true + dev: false + /typescript@5.6.2: resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} engines: {node: '>=14.17'} @@ -13835,7 +13872,7 @@ packages: dev: false file:projects/arm-containerservicefleet.tgz: - resolution: {integrity: sha512-PQcr24oEdrDmHejzWucB0wHC97fJYA0bMoBDyilrYMNbHCS0pK7QDKMdK4mGsai7bqz2o+qSS+8DbqOXLTX1PQ==, tarball: file:projects/arm-containerservicefleet.tgz} + resolution: {integrity: sha512-YHf/+6R5SjC43LsmXzH7KqGGf2qVTBtS9DOMz6LD9eChAA0Y+5rbzkIu4cGSgqiSd6j1qrknJfJqwy9L8NM43A==, tarball: file:projects/arm-containerservicefleet.tgz} name: '@rush-temp/arm-containerservicefleet' version: 0.0.0 dependencies: @@ -13854,10 +13891,10 @@ packages: mkdirp: 3.0.1 mocha: 10.7.3 rimraf: 5.0.10 - ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.6.2) + ts-node: 10.9.2(@types/node@18.19.50)(typescript@5.5.4) tslib: 2.7.0 tsx: 4.19.1 - typescript: 5.6.2 + typescript: 5.5.4 uglify-js: 3.19.3 transitivePeerDependencies: - '@swc/core' diff --git a/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md b/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md index 022d0ae355e5..5f0d16aaaea1 100644 --- a/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md @@ -1,15 +1,38 @@ # Release History - -## 1.1.1 (Unreleased) - + +## 1.2.0-beta.1 (2024-09-20) +Compared with version 1.1.0 + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group AutoUpgradeProfiles + - Added Interface AutoUpgradeNodeImageSelection + - Added Interface AutoUpgradeProfile + - Added Interface AutoUpgradeProfileListResult + - Added Interface AutoUpgradeProfilesCreateOrUpdateHeaders + - Added Interface AutoUpgradeProfilesCreateOrUpdateOptionalParams + - Added Interface AutoUpgradeProfilesDeleteHeaders + - Added Interface AutoUpgradeProfilesDeleteOptionalParams + - Added Interface AutoUpgradeProfilesGetOptionalParams + - Added Interface AutoUpgradeProfilesListByFleetNextOptionalParams + - Added Interface AutoUpgradeProfilesListByFleetOptionalParams + - Added Type Alias AutoUpgradeNodeImageSelectionType + - Added Type Alias AutoUpgradeProfileProvisioningState + - Added Type Alias AutoUpgradeProfilesCreateOrUpdateResponse + - Added Type Alias AutoUpgradeProfilesDeleteResponse + - Added Type Alias AutoUpgradeProfilesGetResponse + - Added Type Alias AutoUpgradeProfilesListByFleetNextResponse + - Added Type Alias AutoUpgradeProfilesListByFleetResponse + - Added Type Alias UpgradeChannel + - Interface APIServerAccessProfile has a new optional parameter enableVnetIntegration + - Interface APIServerAccessProfile has a new optional parameter subnetId + - Interface NodeImageSelection has a new optional parameter customNodeImageVersions + - Added Enum KnownAutoUpgradeNodeImageSelectionType + - Added Enum KnownAutoUpgradeProfileProvisioningState + - Added Enum KnownUpgradeChannel + - Enum KnownNodeImageSelectionType has a new value Custom + + ## 1.1.0 (2024-05-15) ### Features Added diff --git a/sdk/containerservice/arm-containerservicefleet/README.md b/sdk/containerservice/arm-containerservicefleet/README.md index 8ae337adf1ac..12ea86bbe15c 100644 --- a/sdk/containerservice/arm-containerservicefleet/README.md +++ b/sdk/containerservice/arm-containerservicefleet/README.md @@ -6,7 +6,7 @@ Azure Kubernetes Fleet Manager api client. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservicefleet) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-containerservicefleet) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerservicefleet) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-containerservicefleet?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/containerservice/arm-containerservicefleet/_meta.json b/sdk/containerservice/arm-containerservicefleet/_meta.json index 61090facd453..10865ff1b567 100644 --- a/sdk/containerservice/arm-containerservicefleet/_meta.json +++ b/sdk/containerservice/arm-containerservicefleet/_meta.json @@ -1,8 +1,8 @@ { - "commit": "e23546dc961836d2a87a6cb014aadcaa8648ed9b", + "commit": "c37f1cda49a6fd82cf0925dc5b7d1654d1f01d63", "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md", - "autorest_command": "autorest --version=3.9.7 --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\\Microsoft.ContainerService\\fleet\\readme.md --use=@autorest/typescript@6.0.22 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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/Microsoft.ContainerService/fleet/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.9", - "use": "@autorest/typescript@6.0.22" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.14", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservicefleet/package.json b/sdk/containerservice/arm-containerservicefleet/package.json index 031936f6b886..ba695bc4197a 100644 --- a/sdk/containerservice/arm-containerservicefleet/package.json +++ b/sdk/containerservice/arm-containerservicefleet/package.json @@ -3,13 +3,13 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ContainerServiceFleetClient.", - "version": "1.1.1", + "version": "1.2.0-beta.1", "engines": { "node": ">=18.0.0" }, "dependencies": { "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.6.0", @@ -30,12 +30,12 @@ "devDependencies": { "@microsoft/api-extractor": "^7.31.1", "mkdirp": "^3.0.1", - "typescript": "~5.6.2", + "typescript": "~5.5.3", "uglify-js": "^3.4.9", "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", @@ -106,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservicefleet", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-containerservicefleet?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/containerservice/arm-containerservicefleet" +} \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md b/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md index 0165b10dce83..2153377a631e 100644 --- a/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md +++ b/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md @@ -22,8 +22,101 @@ export interface AgentProfile { // @public export interface APIServerAccessProfile { enablePrivateCluster?: boolean; + enableVnetIntegration?: boolean; + subnetId?: string; +} + +// @public +export interface AutoUpgradeNodeImageSelection { + type: AutoUpgradeNodeImageSelectionType; +} + +// @public +export type AutoUpgradeNodeImageSelectionType = string; + +// @public +export interface AutoUpgradeProfile extends ProxyResource { + channel?: UpgradeChannel; + disabled?: boolean; + readonly eTag?: string; + nodeImageSelection?: AutoUpgradeNodeImageSelection; + readonly provisioningState?: AutoUpgradeProfileProvisioningState; + updateStrategyId?: string; +} + +// @public +export interface AutoUpgradeProfileListResult { + nextLink?: string; + value: AutoUpgradeProfile[]; +} + +// @public +export type AutoUpgradeProfileProvisioningState = string; + +// @public +export interface AutoUpgradeProfiles { + beginCreateOrUpdate(resourceGroupName: string, fleetName: string, autoUpgradeProfileName: string, resource: AutoUpgradeProfile, options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams): Promise, AutoUpgradeProfilesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, fleetName: string, autoUpgradeProfileName: string, resource: AutoUpgradeProfile, options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, fleetName: string, autoUpgradeProfileName: string, options?: AutoUpgradeProfilesDeleteOptionalParams): Promise, AutoUpgradeProfilesDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, fleetName: string, autoUpgradeProfileName: string, options?: AutoUpgradeProfilesDeleteOptionalParams): Promise; + get(resourceGroupName: string, fleetName: string, autoUpgradeProfileName: string, options?: AutoUpgradeProfilesGetOptionalParams): Promise; + listByFleet(resourceGroupName: string, fleetName: string, options?: AutoUpgradeProfilesListByFleetOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AutoUpgradeProfilesCreateOrUpdateHeaders { + azureAsyncOperation?: string; + retryAfter?: number; +} + +// @public +export interface AutoUpgradeProfilesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + ifNoneMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AutoUpgradeProfilesCreateOrUpdateResponse = AutoUpgradeProfile; + +// @public +export interface AutoUpgradeProfilesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface AutoUpgradeProfilesDeleteOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type AutoUpgradeProfilesDeleteResponse = AutoUpgradeProfilesDeleteHeaders; + +// @public +export interface AutoUpgradeProfilesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoUpgradeProfilesGetResponse = AutoUpgradeProfile; + +// @public +export interface AutoUpgradeProfilesListByFleetNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AutoUpgradeProfilesListByFleetNextResponse = AutoUpgradeProfileListResult; + +// @public +export interface AutoUpgradeProfilesListByFleetOptionalParams extends coreClient.OperationOptions { } +// @public +export type AutoUpgradeProfilesListByFleetResponse = AutoUpgradeProfileListResult; + // @public (undocumented) export class ContainerServiceFleetClient extends coreClient.ServiceClient { // (undocumented) @@ -32,6 +125,8 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { // (undocumented) apiVersion: string; // (undocumented) + autoUpgradeProfiles: AutoUpgradeProfiles; + // (undocumented) fleetMembers: FleetMembers; // (undocumented) fleets: Fleets; @@ -406,6 +501,19 @@ export enum KnownActionType { Internal = "Internal" } +// @public +export enum KnownAutoUpgradeNodeImageSelectionType { + Consistent = "Consistent", + Latest = "Latest" +} + +// @public +export enum KnownAutoUpgradeProfileProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -459,6 +567,7 @@ export enum KnownManagedServiceIdentityType { // @public export enum KnownNodeImageSelectionType { Consistent = "Consistent", + Custom = "Custom", Latest = "Latest" } @@ -495,6 +604,13 @@ export enum KnownUpdateState { Stopping = "Stopping" } +// @public +export enum KnownUpgradeChannel { + NodeImage = "NodeImage", + Rapid = "Rapid", + Stable = "Stable" +} + // @public export interface ManagedClusterUpdate { nodeImageSelection?: NodeImageSelection; @@ -534,6 +650,7 @@ export interface MemberUpdateStatus { // @public export interface NodeImageSelection { + customNodeImageVersions?: NodeImageVersion[]; type: NodeImageSelectionType; } @@ -822,6 +939,9 @@ export interface UpdateStatus { readonly state?: UpdateState; } +// @public +export type UpgradeChannel = string; + // @public export interface UserAssignedIdentity { readonly clientId?: string; diff --git a/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts b/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts index 691254e698f0..8d9f2c2832ce 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts @@ -17,6 +17,7 @@ import * as coreAuth from "@azure/core-auth"; import { OperationsImpl, FleetsImpl, + AutoUpgradeProfilesImpl, FleetMembersImpl, UpdateRunsImpl, FleetUpdateStrategiesImpl, @@ -24,6 +25,7 @@ import { import { Operations, Fleets, + AutoUpgradeProfiles, FleetMembers, UpdateRuns, FleetUpdateStrategies, @@ -62,7 +64,7 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { credential: credentials, }; - const packageDetails = `azsdk-js-arm-containerservicefleet/1.1.1`; + const packageDetails = `azsdk-js-arm-containerservicefleet/1.2.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -116,9 +118,10 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-04-01"; + this.apiVersion = options.apiVersion || "2024-05-02-preview"; this.operations = new OperationsImpl(this); this.fleets = new FleetsImpl(this); + this.autoUpgradeProfiles = new AutoUpgradeProfilesImpl(this); this.fleetMembers = new FleetMembersImpl(this); this.updateRuns = new UpdateRunsImpl(this); this.fleetUpdateStrategies = new FleetUpdateStrategiesImpl(this); @@ -155,6 +158,7 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { operations: Operations; fleets: Fleets; + autoUpgradeProfiles: AutoUpgradeProfiles; fleetMembers: FleetMembers; updateRuns: UpdateRuns; fleetUpdateStrategies: FleetUpdateStrategies; diff --git a/sdk/containerservice/arm-containerservicefleet/src/models/index.ts b/sdk/containerservice/arm-containerservicefleet/src/models/index.ts index a0f918df13a4..ed73b716ae73 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/index.ts @@ -158,6 +158,10 @@ export interface FleetHubProfile { export interface APIServerAccessProfile { /** Whether to create the Fleet hub as a private cluster or not. */ enablePrivateCluster?: boolean; + /** Whether to enable apiserver vnet integration for the Fleet hub or not. */ + enableVnetIntegration?: boolean; + /** The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. */ + subnetId?: string; } /** Agent profile for the Fleet hub. */ @@ -248,6 +252,20 @@ export interface FleetPatch { identity?: ManagedServiceIdentity; } +/** The response of a AutoUpgradeProfile list operation. */ +export interface AutoUpgradeProfileListResult { + /** The AutoUpgradeProfile items on this page */ + value: AutoUpgradeProfile[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** The node image upgrade to be applied to the target clusters in auto upgrade. */ +export interface AutoUpgradeNodeImageSelection { + /** The node image upgrade type. */ + type: AutoUpgradeNodeImageSelectionType; +} + /** The Credential results response. */ export interface FleetCredentialResults { /** @@ -346,6 +364,17 @@ export interface ManagedClusterUpgradeSpec { export interface NodeImageSelection { /** The node image upgrade type. */ type: NodeImageSelectionType; + /** Custom node image versions to upgrade the nodes to. This field is required if node image selection type is Custom. Otherwise, it must be empty. For each node image family (e.g., 'AKSUbuntu-1804gen2containerd'), this field can contain at most one version (e.g., only one of 'AKSUbuntu-1804gen2containerd-2023.01.12' or 'AKSUbuntu-1804gen2containerd-2023.02.12', not both). If the nodes belong to a family without a matching image version in this field, they are not upgraded. */ + customNodeImageVersions?: NodeImageVersion[]; +} + +/** The node upgrade image version. */ +export interface NodeImageVersion { + /** + * The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly version?: string; } /** The status of a UpdateRun. */ @@ -486,15 +515,6 @@ export interface NodeImageSelectionStatus { readonly selectedNodeImageVersions?: NodeImageVersion[]; } -/** The node upgrade image version. */ -export interface NodeImageVersion { - /** - * The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13'). - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly version?: string; -} - /** The properties of a skip operation containing multiple skip requests. */ export interface SkipProperties { /** The targets to skip. */ @@ -550,6 +570,33 @@ export interface Fleet extends TrackedResource { hubProfile?: FleetHubProfile; } +/** The AutoUpgradeProfile resource. */ +export interface AutoUpgradeProfile extends ProxyResource { + /** + * If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly eTag?: string; + /** + * The provisioning state of the AutoUpgradeProfile resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: AutoUpgradeProfileProvisioningState; + /** The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. */ + updateStrategyId?: string; + /** Configures how auto-upgrade will be run. */ + channel?: UpgradeChannel; + /** The node image upgrade to be applied to the target clusters in auto upgrade. */ + nodeImageSelection?: AutoUpgradeNodeImageSelection; + /** + * If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + * If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + * This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + * By default, this is set to False. + */ + disabled?: boolean; +} + /** A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. */ export interface FleetMember extends ProxyResource { /** @@ -648,6 +695,22 @@ export interface FleetsDeleteHeaders { retryAfter?: number; } +/** Defines headers for AutoUpgradeProfiles_createOrUpdate operation. */ +export interface AutoUpgradeProfilesCreateOrUpdateHeaders { + /** A link to the status monitor */ + azureAsyncOperation?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for AutoUpgradeProfiles_delete operation. */ +export interface AutoUpgradeProfilesDeleteHeaders { + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + /** Defines headers for FleetMembers_create operation. */ export interface FleetMembersCreateHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ @@ -836,6 +899,70 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link AutoUpgradeProfileProvisioningState} that the service accepts. */ +export enum KnownAutoUpgradeProfileProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled", +} + +/** + * Defines values for AutoUpgradeProfileProvisioningState. \ + * {@link KnownAutoUpgradeProfileProvisioningState} can be used interchangeably with AutoUpgradeProfileProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. + */ +export type AutoUpgradeProfileProvisioningState = string; + +/** Known values of {@link UpgradeChannel} that the service accepts. */ +export enum KnownUpgradeChannel { + /** + * Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is the latest supported minor version. + * For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster upgrades to 1.18.6. + */ + Stable = "Stable", + /** Upgrades the clusters kubernetes version to the latest supported patch release on the latest supported minor version. */ + Rapid = "Rapid", + /** Upgrade node image version of the clusters. */ + NodeImage = "NodeImage", +} + +/** + * Defines values for UpgradeChannel. \ + * {@link KnownUpgradeChannel} can be used interchangeably with UpgradeChannel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Stable**: Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is the latest supported minor version. + * For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster upgrades to 1.18.6. \ + * **Rapid**: Upgrades the clusters kubernetes version to the latest supported patch release on the latest supported minor version. \ + * **NodeImage**: Upgrade node image version of the clusters. + */ +export type UpgradeChannel = string; + +/** Known values of {@link AutoUpgradeNodeImageSelectionType} that the service accepts. */ +export enum KnownAutoUpgradeNodeImageSelectionType { + /** Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. */ + Latest = "Latest", + /** The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. */ + Consistent = "Consistent", +} + +/** + * Defines values for AutoUpgradeNodeImageSelectionType. \ + * {@link KnownAutoUpgradeNodeImageSelectionType} can be used interchangeably with AutoUpgradeNodeImageSelectionType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Latest**: Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. \ + * **Consistent**: The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + */ +export type AutoUpgradeNodeImageSelectionType = string; + /** Known values of {@link FleetMemberProvisioningState} that the service accepts. */ export enum KnownFleetMemberProvisioningState { /** Resource has been created. */ @@ -914,6 +1041,8 @@ export enum KnownNodeImageSelectionType { Latest = "Latest", /** The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. */ Consistent = "Consistent", + /** Upgrade the nodes to the custom image versions. When set, update run will use node image versions provided in customNodeImageVersions to upgrade the nodes. If set, customNodeImageVersions must not be empty. */ + Custom = "Custom", } /** @@ -922,7 +1051,8 @@ export enum KnownNodeImageSelectionType { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Latest**: Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. \ - * **Consistent**: The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + * **Consistent**: The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. \ + * **Custom**: Upgrade the nodes to the custom image versions. When set, update run will use node image versions provided in customNodeImageVersions to upgrade the nodes. If set, customNodeImageVersions must not be empty. */ export type NodeImageSelectionType = string; @@ -1100,6 +1230,60 @@ export interface FleetsListByResourceGroupNextOptionalParams /** Contains response data for the listByResourceGroupNext operation. */ export type FleetsListByResourceGroupNextResponse = FleetListResult; +/** Optional parameters. */ +export interface AutoUpgradeProfilesListByFleetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFleet operation. */ +export type AutoUpgradeProfilesListByFleetResponse = + AutoUpgradeProfileListResult; + +/** Optional parameters. */ +export interface AutoUpgradeProfilesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AutoUpgradeProfilesGetResponse = AutoUpgradeProfile; + +/** Optional parameters. */ +export interface AutoUpgradeProfilesCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { + /** The request should only proceed if an entity matches this string. */ + ifMatch?: string; + /** The request should only proceed if no entity matches this string. */ + 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 AutoUpgradeProfilesCreateOrUpdateResponse = AutoUpgradeProfile; + +/** Optional parameters. */ +export interface AutoUpgradeProfilesDeleteOptionalParams + extends coreClient.OperationOptions { + /** The request should only proceed if an entity matches this string. */ + 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; +} + +/** Contains response data for the delete operation. */ +export type AutoUpgradeProfilesDeleteResponse = + AutoUpgradeProfilesDeleteHeaders; + +/** Optional parameters. */ +export interface AutoUpgradeProfilesListByFleetNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFleetNext operation. */ +export type AutoUpgradeProfilesListByFleetNextResponse = + AutoUpgradeProfileListResult; + /** Optional parameters. */ export interface FleetMembersListByFleetOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts b/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts index df867d74921d..b707b96652d5 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts @@ -310,6 +310,18 @@ export const APIServerAccessProfile: coreClient.CompositeMapper = { name: "Boolean", }, }, + enableVnetIntegration: { + serializedName: "enableVnetIntegration", + type: { + name: "Boolean", + }, + }, + subnetId: { + serializedName: "subnetId", + type: { + name: "String", + }, + }, }, }, }; @@ -502,6 +514,50 @@ export const FleetPatch: coreClient.CompositeMapper = { }, }; +export const AutoUpgradeProfileListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoUpgradeProfileListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AutoUpgradeProfile", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AutoUpgradeNodeImageSelection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoUpgradeNodeImageSelection", + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String", + }, + }, + }, + }, +}; + export const FleetCredentialResults: coreClient.CompositeMapper = { type: { name: "Composite", @@ -762,6 +818,34 @@ export const NodeImageSelection: coreClient.CompositeMapper = { name: "String", }, }, + customNodeImageVersions: { + serializedName: "customNodeImageVersions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "NodeImageVersion", + }, + }, + }, + }, + }, + }, +}; + +export const NodeImageVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NodeImageVersion", + modelProperties: { + version: { + serializedName: "version", + readOnly: true, + type: { + name: "String", + }, + }, }, }, }; @@ -1007,22 +1091,6 @@ export const NodeImageSelectionStatus: coreClient.CompositeMapper = { }, }; -export const NodeImageVersion: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NodeImageVersion", - modelProperties: { - version: { - serializedName: "version", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - export const SkipProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1168,6 +1236,55 @@ export const Fleet: coreClient.CompositeMapper = { }, }; +export const AutoUpgradeProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoUpgradeProfile", + modelProperties: { + ...ProxyResource.type.modelProperties, + eTag: { + serializedName: "eTag", + readOnly: true, + type: { + name: "String", + }, + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + updateStrategyId: { + serializedName: "properties.updateStrategyId", + type: { + name: "String", + }, + }, + channel: { + serializedName: "properties.channel", + type: { + name: "String", + }, + }, + nodeImageSelection: { + serializedName: "properties.nodeImageSelection", + type: { + name: "Composite", + className: "AutoUpgradeNodeImageSelection", + }, + }, + disabled: { + serializedName: "properties.disabled", + type: { + name: "Boolean", + }, + }, + }, + }, +}; + export const FleetMember: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1348,6 +1465,49 @@ export const FleetsDeleteHeaders: coreClient.CompositeMapper = { }, }; +export const AutoUpgradeProfilesCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "AutoUpgradeProfilesCreateOrUpdateHeaders", + modelProperties: { + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, + }; + +export const AutoUpgradeProfilesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AutoUpgradeProfilesDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, + }, + }, + }, +}; + export const FleetMembersCreateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts b/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts index 3a626d882f18..9383608a00bc 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts @@ -14,6 +14,7 @@ import { import { Fleet as FleetMapper, FleetPatch as FleetPatchMapper, + AutoUpgradeProfile as AutoUpgradeProfileMapper, FleetMember as FleetMemberMapper, FleetMemberUpdate as FleetMemberUpdateMapper, UpdateRun as UpdateRunMapper, @@ -48,7 +49,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2024-04-01", + defaultValue: "2024-05-02-preview", isConstant: true, serializedName: "api-version", type: { @@ -156,6 +157,27 @@ export const properties: OperationParameter = { mapper: FleetPatchMapper, }; +export const autoUpgradeProfileName: OperationURLParameter = { + parameterPath: "autoUpgradeProfileName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"), + MaxLength: 50, + MinLength: 1, + }, + serializedName: "autoUpgradeProfileName", + required: true, + type: { + name: "String", + }, + }, +}; + +export const resource1: OperationParameter = { + parameterPath: "resource", + mapper: AutoUpgradeProfileMapper, +}; + export const fleetMemberName: OperationURLParameter = { parameterPath: "fleetMemberName", mapper: { @@ -172,7 +194,7 @@ export const fleetMemberName: OperationURLParameter = { }, }; -export const resource1: OperationParameter = { +export const resource2: OperationParameter = { parameterPath: "resource", mapper: FleetMemberMapper, }; @@ -198,7 +220,7 @@ export const updateRunName: OperationURLParameter = { }, }; -export const resource2: OperationParameter = { +export const resource3: OperationParameter = { parameterPath: "resource", mapper: UpdateRunMapper, }; @@ -224,7 +246,7 @@ export const updateStrategyName: OperationURLParameter = { }, }; -export const resource3: OperationParameter = { +export const resource4: OperationParameter = { parameterPath: "resource", mapper: FleetUpdateStrategyMapper, }; diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/autoUpgradeProfiles.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/autoUpgradeProfiles.ts new file mode 100644 index 000000000000..4b31058e2399 --- /dev/null +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/autoUpgradeProfiles.ts @@ -0,0 +1,520 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AutoUpgradeProfiles } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { ContainerServiceFleetClient } from "../containerServiceFleetClient"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; +import { + AutoUpgradeProfile, + AutoUpgradeProfilesListByFleetNextOptionalParams, + AutoUpgradeProfilesListByFleetOptionalParams, + AutoUpgradeProfilesListByFleetResponse, + AutoUpgradeProfilesGetOptionalParams, + AutoUpgradeProfilesGetResponse, + AutoUpgradeProfilesCreateOrUpdateOptionalParams, + AutoUpgradeProfilesCreateOrUpdateResponse, + AutoUpgradeProfilesDeleteOptionalParams, + AutoUpgradeProfilesDeleteResponse, + AutoUpgradeProfilesListByFleetNextResponse, +} from "../models"; + +/// +/** Class containing AutoUpgradeProfiles operations. */ +export class AutoUpgradeProfilesImpl implements AutoUpgradeProfiles { + private readonly client: ContainerServiceFleetClient; + + /** + * Initialize a new instance of the class AutoUpgradeProfiles class. + * @param client Reference to the service client + */ + constructor(client: ContainerServiceFleetClient) { + this.client = client; + } + + /** + * List AutoUpgradeProfile resources by 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?: AutoUpgradeProfilesListByFleetOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByFleetPagingAll( + resourceGroupName, + fleetName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByFleetPagingPage( + resourceGroupName, + fleetName, + options, + settings, + ); + }, + }; + } + + private async *listByFleetPagingPage( + resourceGroupName: string, + fleetName: string, + options?: AutoUpgradeProfilesListByFleetOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: AutoUpgradeProfilesListByFleetResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByFleet(resourceGroupName, fleetName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByFleetNext( + resourceGroupName, + fleetName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByFleetPagingAll( + resourceGroupName: string, + fleetName: string, + options?: AutoUpgradeProfilesListByFleetOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByFleetPagingPage( + resourceGroupName, + fleetName, + options, + )) { + yield* page; + } + } + + /** + * List AutoUpgradeProfile resources by 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?: AutoUpgradeProfilesListByFleetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fleetName, options }, + listByFleetOperationSpec, + ); + } + + /** + * Get a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fleetName, autoUpgradeProfileName, options }, + getOperationSpec, + ); + } + + /** + * Create a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + resource: AutoUpgradeProfile, + options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoUpgradeProfilesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + fleetName, + autoUpgradeProfileName, + resource, + options, + }, + spec: createOrUpdateOperationSpec, + }); + const poller = await createHttpPoller< + AutoUpgradeProfilesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation", + }); + await poller.poll(); + return poller; + } + + /** + * Create a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + resource: AutoUpgradeProfile, + options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams, + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + fleetName, + autoUpgradeProfileName, + resource, + options, + ); + return poller.pollUntilDone(); + } + + /** + * Delete a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoUpgradeProfilesDeleteResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec, + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperationFn = 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 = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, fleetName, autoUpgradeProfileName, options }, + spec: deleteOperationSpec, + }); + const poller = await createHttpPoller< + AutoUpgradeProfilesDeleteResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location", + }); + await poller.poll(); + return poller; + } + + /** + * Delete a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + fleetName, + autoUpgradeProfileName, + options, + ); + return poller.pollUntilDone(); + } + + /** + * 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?: AutoUpgradeProfilesListByFleetNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fleetName, nextLink, options }, + listByFleetNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByFleetOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoUpgradeProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoUpgradeProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.autoUpgradeProfileName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.AutoUpgradeProfile, + }, + 201: { + bodyMapper: Mappers.AutoUpgradeProfile, + }, + 202: { + bodyMapper: Mappers.AutoUpgradeProfile, + }, + 204: { + bodyMapper: Mappers.AutoUpgradeProfile, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.resource1, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.autoUpgradeProfileName, + ], + headerParameters: [ + Parameters.accept, + Parameters.contentType, + Parameters.ifMatch, + Parameters.ifNoneMatch, + ], + mediaType: "json", + serializer, +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}", + httpMethod: "DELETE", + responses: { + 200: { + headersMapper: Mappers.AutoUpgradeProfilesDeleteHeaders, + }, + 201: { + headersMapper: Mappers.AutoUpgradeProfilesDeleteHeaders, + }, + 202: { + headersMapper: Mappers.AutoUpgradeProfilesDeleteHeaders, + }, + 204: { + headersMapper: Mappers.AutoUpgradeProfilesDeleteHeaders, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.autoUpgradeProfileName, + ], + headerParameters: [Parameters.accept, Parameters.ifMatch], + serializer, +}; +const listByFleetNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AutoUpgradeProfileListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts index cbb6339c305b..c4e6b9667879 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts @@ -548,7 +548,7 @@ const createOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.resource1, + requestBody: Parameters.resource2, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts index 6b4c3aebac53..245dc773dc0c 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts @@ -439,7 +439,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.resource3, + requestBody: Parameters.resource4, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts index 6f4281d1da5b..e95cc610206a 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts @@ -8,6 +8,7 @@ export * from "./operations"; export * from "./fleets"; +export * from "./autoUpgradeProfiles"; export * from "./fleetMembers"; export * from "./updateRuns"; export * from "./fleetUpdateStrategies"; diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/updateRuns.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/updateRuns.ts index 3747cd6ebb42..54a60247eec6 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/updateRuns.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/updateRuns.ts @@ -730,7 +730,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.resource2, + requestBody: Parameters.resource3, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/autoUpgradeProfiles.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/autoUpgradeProfiles.ts new file mode 100644 index 000000000000..e4fab5ef6f12 --- /dev/null +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/autoUpgradeProfiles.ts @@ -0,0 +1,115 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { SimplePollerLike, OperationState } from "@azure/core-lro"; +import { + AutoUpgradeProfile, + AutoUpgradeProfilesListByFleetOptionalParams, + AutoUpgradeProfilesGetOptionalParams, + AutoUpgradeProfilesGetResponse, + AutoUpgradeProfilesCreateOrUpdateOptionalParams, + AutoUpgradeProfilesCreateOrUpdateResponse, + AutoUpgradeProfilesDeleteOptionalParams, + AutoUpgradeProfilesDeleteResponse, +} from "../models"; + +/// +/** Interface representing a AutoUpgradeProfiles. */ +export interface AutoUpgradeProfiles { + /** + * List AutoUpgradeProfile resources by 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?: AutoUpgradeProfilesListByFleetOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesGetOptionalParams, + ): Promise; + /** + * Create a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + resource: AutoUpgradeProfile, + options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoUpgradeProfilesCreateOrUpdateResponse + > + >; + /** + * Create a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + resource: AutoUpgradeProfile, + options?: AutoUpgradeProfilesCreateOrUpdateOptionalParams, + ): Promise; + /** + * Delete a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AutoUpgradeProfilesDeleteResponse + > + >; + /** + * Delete a AutoUpgradeProfile + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param autoUpgradeProfileName The name of the AutoUpgradeProfile resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + fleetName: string, + autoUpgradeProfileName: string, + options?: AutoUpgradeProfilesDeleteOptionalParams, + ): Promise; +} diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts index 6f4281d1da5b..e95cc610206a 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts @@ -8,6 +8,7 @@ export * from "./operations"; export * from "./fleets"; +export * from "./autoUpgradeProfiles"; export * from "./fleetMembers"; export * from "./updateRuns"; export * from "./fleetUpdateStrategies"; diff --git a/sdk/containerservice/arm-containerservicefleet/test/sampleTest.ts b/sdk/containerservice/arm-containerservicefleet/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/containerservice/arm-containerservicefleet/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-containerservicefleet/tsconfig.json b/sdk/containerservice/arm-containerservicefleet/tsconfig.json index c25c8faa4dad..3e6ae96443f3 100644 --- a/sdk/containerservice/arm-containerservicefleet/tsconfig.json +++ b/sdk/containerservice/arm-containerservicefleet/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-containerservicefleet": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"