From 146e1590fde094bf0ca2953a423206019151c602 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 31 Aug 2023 22:03:17 +0000 Subject: [PATCH] CodeGen from PR 25582 in Azure/azure-rest-api-specs Merge 7862867e826f96cbae25d029b2e99b4c8990e9c9 into 149b98b9201ba4f1dbcc4850379a575451377bf2 --- .../arm-containerservicefleet/CHANGELOG.md | 63 ++- .../arm-containerservicefleet/_meta.json | 8 +- .../arm-containerservicefleet/package.json | 20 +- .../review/arm-containerservicefleet.api.md | 179 +++++- .../src/containerServiceFleetClient.ts | 10 +- .../src/models/index.ts | 399 ++++++++++++-- .../src/models/mappers.ts | 350 ++++++++++++ .../src/models/parameters.ts | 26 +- .../src/operations/fleetMembers.ts | 103 +++- .../src/operations/fleetUpdateStrategies.ts | 509 ++++++++++++++++++ .../src/operations/fleets.ts | 91 +++- .../src/operations/index.ts | 1 + .../src/operationsInterfaces/fleetMembers.ts | 22 +- .../fleetUpdateStrategies.ts | 109 ++++ .../src/operationsInterfaces/fleets.ts | 17 +- .../src/operationsInterfaces/index.ts | 1 + .../test/sampleTest.ts | 43 ++ .../arm-containerservicefleet/tsconfig.json | 10 +- 18 files changed, 1851 insertions(+), 110 deletions(-) create mode 100644 sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts create mode 100644 sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetUpdateStrategies.ts create mode 100644 sdk/containerservice/arm-containerservicefleet/test/sampleTest.ts diff --git a/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md b/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md index b8e5ac827d58..6881d3ad68fc 100644 --- a/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md +++ b/sdk/containerservice/arm-containerservicefleet/CHANGELOG.md @@ -1,15 +1,62 @@ # Release History + +## 1.0.0-beta.2 (2023-08-31) + +**Features** -## 1.0.0-beta.2 (Unreleased) + - Added operation group FleetUpdateStrategies + - Added operation FleetMembers.beginUpdate + - Added operation FleetMembers.beginUpdateAndWait + - Added operation Fleets.beginUpdate + - Added operation Fleets.beginUpdateAndWait + - Added Interface AgentProfile + - Added Interface APIServerAccessProfile + - Added Interface FleetMembersUpdateHeaders + - Added Interface FleetsUpdateHeaders + - Added Interface FleetUpdateStrategiesCreateOrUpdateHeaders + - Added Interface FleetUpdateStrategiesCreateOrUpdateOptionalParams + - Added Interface FleetUpdateStrategiesDeleteHeaders + - Added Interface FleetUpdateStrategiesDeleteOptionalParams + - Added Interface FleetUpdateStrategiesGetOptionalParams + - Added Interface FleetUpdateStrategiesListByFleetNextOptionalParams + - Added Interface FleetUpdateStrategiesListByFleetOptionalParams + - Added Interface FleetUpdateStrategy + - Added Interface FleetUpdateStrategyListResult + - Added Interface ManagedServiceIdentity + - Added Interface NodeImageSelection + - Added Interface NodeImageSelectionStatus + - Added Interface NodeImageVersion + - Added Interface UserAssignedIdentity + - Added Type Alias FleetUpdateStrategiesCreateOrUpdateResponse + - Added Type Alias FleetUpdateStrategiesGetResponse + - Added Type Alias FleetUpdateStrategiesListByFleetNextResponse + - Added Type Alias FleetUpdateStrategiesListByFleetResponse + - Added Type Alias FleetUpdateStrategyProvisioningState + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias NodeImageSelectionType + - Interface Fleet has a new optional parameter identity + - Interface FleetHubProfile has a new optional parameter agentProfile + - Interface FleetHubProfile has a new optional parameter apiServerAccessProfile + - Interface FleetMembersUpdateOptionalParams has a new optional parameter resumeFrom + - Interface FleetMembersUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface FleetPatch has a new optional parameter identity + - Interface FleetsUpdateOptionalParams has a new optional parameter resumeFrom + - Interface FleetsUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface ManagedClusterUpdate has a new optional parameter nodeImageSelection + - Interface MemberUpdateStatus has a new optional parameter message + - Interface UpdateRun has a new optional parameter updateStrategyId + - Interface UpdateRunStatus has a new optional parameter nodeImageSelection + - Added Enum KnownFleetUpdateStrategyProvisioningState + - Added Enum KnownManagedServiceIdentityType + - Added Enum KnownNodeImageSelectionType + - Enum KnownUpdateState has a new value Skipped -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +**Breaking Changes** + - Removed operation FleetMembers.update + - Removed operation Fleets.update + + ## 1.0.0-beta.1 (2023-06-01) The package of @azure/arm-containerservicefleet is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/js-track2-quickstart). diff --git a/sdk/containerservice/arm-containerservicefleet/_meta.json b/sdk/containerservice/arm-containerservicefleet/_meta.json index 34337de066aa..7a44e292a7d1 100644 --- a/sdk/containerservice/arm-containerservicefleet/_meta.json +++ b/sdk/containerservice/arm-containerservicefleet/_meta.json @@ -1,8 +1,8 @@ { - "commit": "0724e72994ed3c77f76ed0bfa2df3b1f0c33a41b", + "commit": "6755fc5f3200532b623e849d67042a4bf91fb685", "readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\containerservice\\resource-manager\\Microsoft.ContainerService\\fleet\\readme.md --use=@autorest/typescript@6.0.2 --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.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.2" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", + "use": "@autorest/typescript@^6.0.4" } \ No newline at end of file diff --git a/sdk/containerservice/arm-containerservicefleet/package.json b/sdk/containerservice/arm-containerservicefleet/package.json index 3bcc01c2e9ea..98dfa506cc5b 100644 --- a/sdk/containerservice/arm-containerservicefleet/package.json +++ b/sdk/containerservice/arm-containerservicefleet/package.json @@ -8,12 +8,12 @@ "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -48,8 +48,8 @@ "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^14.0.0", - "@azure/dev-tool": "^1.0.0", - "ts-node": "^10.0.0" + "ts-node": "^10.0.0", + "@azure/dev-tool": "^1.0.0" }, "repository": { "type": "git", @@ -112,13 +112,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 ab931328d1e2..ca59df74c015 100644 --- a/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md +++ b/sdk/containerservice/arm-containerservicefleet/review/arm-containerservicefleet.api.md @@ -13,6 +13,18 @@ import { SimplePollerLike } from '@azure/core-lro'; // @public export type ActionType = string; +// @public +export interface AgentProfile { + subnetId?: string; +} + +// @public +export interface APIServerAccessProfile { + enablePrivateCluster?: boolean; + enableVnetIntegration?: boolean; + subnetId?: string; +} + // @public (undocumented) export class ContainerServiceFleetClient extends coreClient.ServiceClient { // (undocumented) @@ -25,6 +37,8 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { // (undocumented) fleets: Fleets; // (undocumented) + fleetUpdateStrategies: FleetUpdateStrategies; + // (undocumented) operations: Operations; // (undocumented) subscriptionId: string; @@ -66,6 +80,7 @@ export interface ErrorResponse { export interface Fleet extends TrackedResource { readonly eTag?: string; hubProfile?: FleetHubProfile; + identity?: ManagedServiceIdentity; readonly provisioningState?: FleetProvisioningState; } @@ -82,6 +97,8 @@ export interface FleetCredentialResults { // @public export interface FleetHubProfile { + agentProfile?: AgentProfile; + apiServerAccessProfile?: APIServerAccessProfile; dnsPrefix?: string; readonly fqdn?: string; readonly kubernetesVersion?: string; @@ -116,9 +133,10 @@ export interface FleetMembers { beginCreateAndWait(resourceGroupName: string, fleetName: string, fleetMemberName: string, resource: FleetMember, options?: FleetMembersCreateOptionalParams): Promise; beginDelete(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, fleetName: string, fleetMemberName: string, properties: FleetMemberUpdate, options?: FleetMembersUpdateOptionalParams): Promise, FleetMembersUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, fleetName: string, fleetMemberName: string, properties: FleetMemberUpdate, options?: FleetMembersUpdateOptionalParams): Promise; get(resourceGroupName: string, fleetName: string, fleetMemberName: string, options?: FleetMembersGetOptionalParams): Promise; listByFleet(resourceGroupName: string, fleetName: string, options?: FleetMembersListByFleetOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, fleetName: string, fleetMemberName: string, properties: FleetMemberUpdate, options?: FleetMembersUpdateOptionalParams): Promise; } // @public @@ -171,9 +189,17 @@ export interface FleetMembersListByFleetOptionalParams extends coreClient.Operat // @public export type FleetMembersListByFleetResponse = FleetMemberListResult; +// @public +export interface FleetMembersUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface FleetMembersUpdateOptionalParams extends coreClient.OperationOptions { ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -186,6 +212,7 @@ export interface FleetMemberUpdate { // @public export interface FleetPatch { + identity?: ManagedServiceIdentity; tags?: { [propertyName: string]: string; }; @@ -200,11 +227,12 @@ export interface Fleets { beginCreateOrUpdateAndWait(resourceGroupName: string, fleetName: string, resource: Fleet, options?: FleetsCreateOrUpdateOptionalParams): Promise; beginDelete(resourceGroupName: string, fleetName: string, options?: FleetsDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, fleetName: string, options?: FleetsDeleteOptionalParams): Promise; + beginUpdate(resourceGroupName: string, fleetName: string, properties: FleetPatch, options?: FleetsUpdateOptionalParams): Promise, FleetsUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, fleetName: string, properties: FleetPatch, options?: FleetsUpdateOptionalParams): Promise; get(resourceGroupName: string, fleetName: string, options?: FleetsGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: FleetsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: FleetsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listCredentials(resourceGroupName: string, fleetName: string, options?: FleetsListCredentialsOptionalParams): Promise; - update(resourceGroupName: string, fleetName: string, properties: FleetPatch, options?: FleetsUpdateOptionalParams): Promise; } // @public @@ -278,14 +306,98 @@ export interface FleetsListCredentialsOptionalParams extends coreClient.Operatio // @public export type FleetsListCredentialsResponse = FleetCredentialResults; +// @public +export interface FleetsUpdateHeaders { + location?: string; + retryAfter?: number; +} + // @public export interface FleetsUpdateOptionalParams extends coreClient.OperationOptions { ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; } // @public export type FleetsUpdateResponse = Fleet; +// @public +export interface FleetUpdateStrategies { + beginCreateOrUpdate(resourceGroupName: string, fleetName: string, updateStrategyName: string, resource: FleetUpdateStrategy, options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams): Promise, FleetUpdateStrategiesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, fleetName: string, updateStrategyName: string, resource: FleetUpdateStrategy, options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, fleetName: string, updateStrategyName: string, options?: FleetUpdateStrategiesDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, fleetName: string, updateStrategyName: string, options?: FleetUpdateStrategiesDeleteOptionalParams): Promise; + get(resourceGroupName: string, fleetName: string, updateStrategyName: string, options?: FleetUpdateStrategiesGetOptionalParams): Promise; + listByFleet(resourceGroupName: string, fleetName: string, options?: FleetUpdateStrategiesListByFleetOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface FleetUpdateStrategiesCreateOrUpdateHeaders { + retryAfter?: number; +} + +// @public +export interface FleetUpdateStrategiesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + ifNoneMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type FleetUpdateStrategiesCreateOrUpdateResponse = FleetUpdateStrategy; + +// @public +export interface FleetUpdateStrategiesDeleteHeaders { + location?: string; + retryAfter?: number; +} + +// @public +export interface FleetUpdateStrategiesDeleteOptionalParams extends coreClient.OperationOptions { + ifMatch?: string; + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export interface FleetUpdateStrategiesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FleetUpdateStrategiesGetResponse = FleetUpdateStrategy; + +// @public +export interface FleetUpdateStrategiesListByFleetNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FleetUpdateStrategiesListByFleetNextResponse = FleetUpdateStrategyListResult; + +// @public +export interface FleetUpdateStrategiesListByFleetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type FleetUpdateStrategiesListByFleetResponse = FleetUpdateStrategyListResult; + +// @public +export interface FleetUpdateStrategy extends ProxyResource { + readonly eTag?: string; + readonly provisioningState?: FleetUpdateStrategyProvisioningState; + strategy?: UpdateRunStrategy; +} + +// @public +export interface FleetUpdateStrategyListResult { + nextLink?: string; + value: FleetUpdateStrategy[]; +} + +// @public +export type FleetUpdateStrategyProvisioningState = string; + // @public export function getContinuationToken(page: unknown): string | undefined; @@ -322,12 +434,33 @@ export enum KnownFleetProvisioningState { Updating = "Updating" } +// @public +export enum KnownFleetUpdateStrategyProvisioningState { + Canceled = "Canceled", + Failed = "Failed", + Succeeded = "Succeeded" +} + // @public export enum KnownManagedClusterUpgradeType { Full = "Full", NodeImageOnly = "NodeImageOnly" } +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownNodeImageSelectionType { + Consistent = "Consistent", + Latest = "Latest" +} + // @public export enum KnownOrigin { System = "system", @@ -348,12 +481,14 @@ export enum KnownUpdateState { Failed = "Failed", NotStarted = "NotStarted", Running = "Running", + Skipped = "Skipped", Stopped = "Stopped", Stopping = "Stopping" } // @public export interface ManagedClusterUpdate { + nodeImageSelection?: NodeImageSelection; upgrade: ManagedClusterUpgradeSpec; } @@ -366,14 +501,46 @@ export interface ManagedClusterUpgradeSpec { // @public export type ManagedClusterUpgradeType = string; +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: { + [propertyName: string]: UserAssignedIdentity; + }; +} + +// @public +export type ManagedServiceIdentityType = string; + // @public export interface MemberUpdateStatus { readonly clusterResourceId?: string; + readonly message?: string; readonly name?: string; readonly operationId?: string; readonly status?: UpdateStatus; } +// @public +export interface NodeImageSelection { + type: NodeImageSelectionType; +} + +// @public +export interface NodeImageSelectionStatus { + readonly selectedNodeImageVersions?: NodeImageVersion[]; +} + +// @public +export type NodeImageSelectionType = string; + +// @public +export interface NodeImageVersion { + readonly version?: string; +} + // @public export interface Operation { readonly actionType?: ActionType; @@ -468,6 +635,7 @@ export interface UpdateRun extends ProxyResource { readonly provisioningState?: UpdateRunProvisioningState; readonly status?: UpdateRunStatus; strategy?: UpdateRunStrategy; + updateStrategyId?: string; } // @public @@ -577,6 +745,7 @@ export type UpdateRunsStopResponse = UpdateRun; // @public export interface UpdateRunStatus { + readonly nodeImageSelection?: NodeImageSelectionStatus; readonly stages?: UpdateStageStatus[]; readonly status?: UpdateStatus; } @@ -612,6 +781,12 @@ export interface UpdateStatus { readonly state?: UpdateState; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // @public export interface WaitStatus { readonly status?: UpdateStatus; diff --git a/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts b/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts index 861fe9b3b697..05154885dc80 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/containerServiceFleetClient.ts @@ -18,13 +18,15 @@ import { OperationsImpl, FleetsImpl, FleetMembersImpl, - UpdateRunsImpl + UpdateRunsImpl, + FleetUpdateStrategiesImpl } from "./operations"; import { Operations, Fleets, FleetMembers, - UpdateRuns + UpdateRuns, + FleetUpdateStrategies } from "./operationsInterfaces"; import { ContainerServiceFleetClientOptionalParams } from "./models"; @@ -113,11 +115,12 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-03-15-preview"; + this.apiVersion = options.apiVersion || "2023-08-15-preview"; this.operations = new OperationsImpl(this); this.fleets = new FleetsImpl(this); this.fleetMembers = new FleetMembersImpl(this); this.updateRuns = new UpdateRunsImpl(this); + this.fleetUpdateStrategies = new FleetUpdateStrategiesImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -153,4 +156,5 @@ export class ContainerServiceFleetClient extends coreClient.ServiceClient { fleets: Fleets; 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 82417682729b..bada17b93862 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/index.ts @@ -133,6 +133,10 @@ export interface FleetListResult { export interface FleetHubProfile { /** DNS prefix used to create the FQDN for the Fleet hub. */ dnsPrefix?: string; + /** The access profile for the Fleet hub API server. */ + apiServerAccessProfile?: APIServerAccessProfile; + /** The agent profile for the Fleet hub. */ + agentProfile?: AgentProfile; /** * The FQDN of the Fleet hub. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -145,6 +149,54 @@ export interface FleetHubProfile { readonly kubernetesVersion?: string; } +/** Access profile for the Fleet hub API server. */ +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. */ +export interface AgentProfile { + /** The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. */ + subnetId?: string; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ + type: ManagedServiceIdentityType; + /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ + userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** + * The principal ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; + /** + * The client ID of the assigned identity. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly clientId?: string; +} + /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -189,6 +241,8 @@ export interface SystemData { export interface FleetPatch { /** Resource tags. */ tags?: { [propertyName: string]: string }; + /** Managed identity. */ + identity?: ManagedServiceIdentity; } /** The Credential results response. */ @@ -236,26 +290,25 @@ export interface UpdateRunListResult { nextLink?: string; } -/** The UpdateRunStrategy configures the sequence of Stages and Groups in which the clusters will be updated. */ +/** + * Defines the update sequence of the clusters via stages and groups. + * + * Stages within a run are executed sequentially one after another. + * Groups within a stage are executed in parallel. + * Member clusters within a group are updated sequentially one after another. + * + * A valid strategy contains no duplicate groups within or across stages. + */ export interface UpdateRunStrategy { - /** The list of stages that compose this update run. */ + /** The list of stages that compose this update run. Min size: 1. */ stages: UpdateStage[]; } -/** - * Contains the groups to be updated by an UpdateRun. - * Update order: - * - Sequential between stages: Stages run sequentially. The previous stage must complete before the next one starts. - * - Parallel within a stage: Groups within a stage run in parallel. - * - Sequential within a group: Clusters within a group are updated sequentially. - */ +/** Defines a stage which contains the groups to update and the steps to take (e.g., wait for a time period) before starting the next stage. */ export interface UpdateStage { /** The name of the stage. Must be unique within the UpdateRun. */ name: string; - /** - * A list of group names that compose the stage. - * The groups will be updated in parallel. Each group name can only appear once in the UpdateRun. - */ + /** Defines the groups to be executed in parallel in this stage. Duplicate groups are not allowed. Min size: 1. */ groups?: UpdateGroup[]; /** The time in seconds to wait at the end of this stage before starting the next one. Defaults to 0 seconds if unspecified. */ afterStageWaitInSeconds?: number; @@ -264,9 +317,8 @@ export interface UpdateStage { /** A group to be updated. */ export interface UpdateGroup { /** - * The name of the Fleet member group to update. - * It should match the name of an existing FleetMember group. - * A group can only appear once across all UpdateStages in the UpdateRun. + * Name of the group. + * It must match a group name of an existing fleet member. */ name: string; } @@ -275,6 +327,8 @@ export interface UpdateGroup { export interface ManagedClusterUpdate { /** The upgrade to apply to the ManagedClusters. */ upgrade: ManagedClusterUpgradeSpec; + /** The node image upgrade to be applied to the target nodes in update run. */ + nodeImageSelection?: NodeImageSelection; } /** The upgrade to apply to a ManagedCluster. */ @@ -289,6 +343,12 @@ export interface ManagedClusterUpgradeSpec { kubernetesVersion?: string; } +/** The node image upgrade to be applied to the target nodes in update run. */ +export interface NodeImageSelection { + /** The node image upgrade type. */ + type: NodeImageSelectionType; +} + /** The status of a UpdateRun. */ export interface UpdateRunStatus { /** @@ -301,6 +361,11 @@ export interface UpdateRunStatus { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly stages?: UpdateStageStatus[]; + /** + * The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nodeImageSelection?: NodeImageSelectionStatus; } /** The status for an operation or group of operations. */ @@ -392,6 +457,11 @@ export interface MemberUpdateStatus { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly operationId?: string; + /** + * The status message after processing the member update operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly message?: string; } /** The status of the wait duration. */ @@ -408,6 +478,32 @@ export interface WaitStatus { readonly waitDurationInSeconds?: number; } +/** The node image upgrade specs for the update run. */ +export interface NodeImageSelectionStatus { + /** + * The image versions to upgrade the nodes to. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + 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 response of a FleetUpdateStrategy list operation. */ +export interface FleetUpdateStrategyListResult { + /** The FleetUpdateStrategy items on this page */ + value: FleetUpdateStrategy[]; + /** The link to the next page of items */ + nextLink?: string; +} + /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { /** Resource tags. */ @@ -426,6 +522,8 @@ export interface Fleet extends TrackedResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly eTag?: string; + /** Managed identity. */ + identity?: ManagedServiceIdentity; /** * The status of the last operation. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -453,7 +551,7 @@ export interface FleetMember extends ProxyResource { readonly provisioningState?: FleetMemberProvisioningState; } -/** An UpdateRun is a multi-stage process to perform update operations across members of a Fleet. */ +/** A multi-stage process to perform update operations across members of a Fleet. */ export interface UpdateRun 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. @@ -465,6 +563,21 @@ export interface UpdateRun extends ProxyResource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly provisioningState?: UpdateRunProvisioningState; + /** + * The resource id of the FleetUpdateStrategy resource to reference. + * + * When creating a new run, there are three ways to define a strategy for the run: + * 1. Define a new strategy in place: Set the "strategy" field. + * 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview) + * 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview) + * + * Setting both "updateStrategyId" and "strategy" is invalid. + * + * UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field. + * Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate. + * UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun. + */ + updateStrategyId?: string; /** * The strategy defines the order in which the clusters will be updated. * If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members. @@ -480,12 +593,36 @@ export interface UpdateRun extends ProxyResource { readonly status?: UpdateRunStatus; } +/** Defines a multi-stage process to perform update operations across members of a Fleet. */ +export interface FleetUpdateStrategy 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 UpdateStrategy resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: FleetUpdateStrategyProvisioningState; + /** Defines the update sequence of the clusters. */ + strategy?: UpdateRunStrategy; +} + /** Defines headers for Fleets_createOrUpdate operation. */ export interface FleetsCreateOrUpdateHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ retryAfter?: number; } +/** Defines headers for Fleets_update operation. */ +export interface FleetsUpdateHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; +} + /** Defines headers for Fleets_delete operation. */ export interface FleetsDeleteHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ @@ -500,6 +637,14 @@ export interface FleetMembersCreateHeaders { retryAfter?: number; } +/** Defines headers for FleetMembers_update operation. */ +export interface FleetMembersUpdateHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; +} + /** Defines headers for FleetMembers_delete operation. */ export interface FleetMembersDeleteHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ @@ -538,6 +683,20 @@ export interface UpdateRunsStopHeaders { location?: string; } +/** Defines headers for FleetUpdateStrategies_createOrUpdate operation. */ +export interface FleetUpdateStrategiesCreateOrUpdateHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; +} + +/** Defines headers for FleetUpdateStrategies_delete operation. */ +export interface FleetUpdateStrategiesDeleteHeaders { + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; + /** The Location header contains the URL where the status of the long running operation can be checked. */ + location?: string; +} + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -576,17 +735,17 @@ export type ActionType = string; /** Known values of {@link FleetProvisioningState} that the service accepts. */ export enum KnownFleetProvisioningState { - /** Succeeded */ + /** Resource has been created. */ Succeeded = "Succeeded", - /** Failed */ + /** Resource creation failed. */ Failed = "Failed", - /** Canceled */ + /** Resource creation was canceled. */ Canceled = "Canceled", - /** Creating */ + /** The provisioning state of a fleet being created. */ Creating = "Creating", - /** Updating */ + /** The provisioning state of a fleet being updated. */ Updating = "Updating", - /** Deleting */ + /** The provisioning state of a fleet being deleted. */ Deleting = "Deleting" } @@ -595,15 +754,39 @@ export enum KnownFleetProvisioningState { * {@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** \ - * **Updating** \ - * **Deleting** + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Creating**: The provisioning state of a fleet being created. \ + * **Updating**: The provisioning state of a fleet being updated. \ + * **Deleting**: The provisioning state of a fleet being deleted. */ export type FleetProvisioningState = string; +/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ +export enum KnownManagedServiceIdentityType { + /** None */ + None = "None", + /** SystemAssigned */ + SystemAssigned = "SystemAssigned", + /** UserAssigned */ + UserAssigned = "UserAssigned", + /** SystemAssignedUserAssigned */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned" +} + +/** + * Defines values for ManagedServiceIdentityType. \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None** \ + * **SystemAssigned** \ + * **UserAssigned** \ + * **SystemAssigned, UserAssigned** + */ +export type ManagedServiceIdentityType = string; + /** Known values of {@link CreatedByType} that the service accepts. */ export enum KnownCreatedByType { /** User */ @@ -630,17 +813,17 @@ export type CreatedByType = string; /** Known values of {@link FleetMemberProvisioningState} that the service accepts. */ export enum KnownFleetMemberProvisioningState { - /** Succeeded */ + /** Resource has been created. */ Succeeded = "Succeeded", - /** Failed */ + /** Resource creation failed. */ Failed = "Failed", - /** Canceled */ + /** Resource creation was canceled. */ Canceled = "Canceled", - /** Joining */ + /** The provisioning state of a member joining a fleet. */ Joining = "Joining", - /** Leaving */ + /** The provisioning state of a member leaving a fleet. */ Leaving = "Leaving", - /** Updating */ + /** The provisioning state of a member being updated. */ Updating = "Updating" } @@ -649,22 +832,22 @@ export enum KnownFleetMemberProvisioningState { * {@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** + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. \ + * **Joining**: The provisioning state of a member joining a fleet. \ + * **Leaving**: The provisioning state of a member leaving a fleet. \ + * **Updating**: The provisioning state of a member being updated. */ export type FleetMemberProvisioningState = string; /** Known values of {@link UpdateRunProvisioningState} that the service accepts. */ export enum KnownUpdateRunProvisioningState { - /** Succeeded */ + /** Resource has been created. */ Succeeded = "Succeeded", - /** Failed */ + /** Resource creation failed. */ Failed = "Failed", - /** Canceled */ + /** Resource creation was canceled. */ Canceled = "Canceled" } @@ -673,9 +856,9 @@ export enum KnownUpdateRunProvisioningState { * {@link KnownUpdateRunProvisioningState} can be used interchangeably with UpdateRunProvisioningState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **Succeeded** \ - * **Failed** \ - * **Canceled** + * **Succeeded**: Resource has been created. \ + * **Failed**: Resource creation failed. \ + * **Canceled**: Resource creation was canceled. */ export type UpdateRunProvisioningState = string; @@ -697,19 +880,39 @@ export enum KnownManagedClusterUpgradeType { */ export type ManagedClusterUpgradeType = string; +/** Known values of {@link NodeImageSelectionType} that the service accepts. */ +export enum KnownNodeImageSelectionType { + /** 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 NodeImageSelectionType. \ + * {@link KnownNodeImageSelectionType} can be used interchangeably with NodeImageSelectionType, + * 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 NodeImageSelectionType = string; + /** Known values of {@link UpdateState} that the service accepts. */ export enum KnownUpdateState { - /** NotStarted */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has not been started. */ NotStarted = "NotStarted", - /** Running */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that is running. */ Running = "Running", - /** Stopping */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that is being stopped. */ Stopping = "Stopping", - /** Stopped */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has stopped. */ Stopped = "Stopped", - /** Failed */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has been skipped. */ + Skipped = "Skipped", + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has failed. */ Failed = "Failed", - /** Completed */ + /** The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has completed. */ Completed = "Completed" } @@ -718,15 +921,37 @@ export enum KnownUpdateState { * {@link KnownUpdateState} can be used interchangeably with UpdateState, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **NotStarted** \ - * **Running** \ - * **Stopping** \ - * **Stopped** \ - * **Failed** \ - * **Completed** + * **NotStarted**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has not been started. \ + * **Running**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that is running. \ + * **Stopping**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that is being stopped. \ + * **Stopped**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has stopped. \ + * **Skipped**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has been skipped. \ + * **Failed**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has failed. \ + * **Completed**: The state of an UpdateRun\/UpdateStage\/UpdateGroup\/MemberUpdate that has completed. */ export type UpdateState = string; +/** Known values of {@link FleetUpdateStrategyProvisioningState} that the service accepts. */ +export enum KnownFleetUpdateStrategyProvisioningState { + /** Resource has been created. */ + Succeeded = "Succeeded", + /** Resource creation failed. */ + Failed = "Failed", + /** Resource creation was canceled. */ + Canceled = "Canceled" +} + +/** + * Defines values for FleetUpdateStrategyProvisioningState. \ + * {@link KnownFleetUpdateStrategyProvisioningState} can be used interchangeably with FleetUpdateStrategyProvisioningState, + * 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 FleetUpdateStrategyProvisioningState = string; + /** Optional parameters. */ export interface OperationsListOptionalParams extends coreClient.OperationOptions {} @@ -782,6 +1007,10 @@ export interface FleetsUpdateOptionalParams 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 update operation. */ @@ -854,6 +1083,10 @@ export interface FleetMembersUpdateOptionalParams 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 update operation. */ @@ -953,6 +1186,54 @@ export interface UpdateRunsListByFleetNextOptionalParams /** Contains response data for the listByFleetNext operation. */ export type UpdateRunsListByFleetNextResponse = UpdateRunListResult; +/** Optional parameters. */ +export interface FleetUpdateStrategiesListByFleetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFleet operation. */ +export type FleetUpdateStrategiesListByFleetResponse = FleetUpdateStrategyListResult; + +/** Optional parameters. */ +export interface FleetUpdateStrategiesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type FleetUpdateStrategiesGetResponse = FleetUpdateStrategy; + +/** Optional parameters. */ +export interface FleetUpdateStrategiesCreateOrUpdateOptionalParams + 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 FleetUpdateStrategiesCreateOrUpdateResponse = FleetUpdateStrategy; + +/** Optional parameters. */ +export interface FleetUpdateStrategiesDeleteOptionalParams + 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; +} + +/** Optional parameters. */ +export interface FleetUpdateStrategiesListByFleetNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFleetNext operation. */ +export type FleetUpdateStrategiesListByFleetNextResponse = FleetUpdateStrategyListResult; + /** Optional parameters. */ export interface ContainerServiceFleetClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts b/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts index 15dfdc79fcc3..f119fbde821a 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/mappers.ts @@ -260,6 +260,20 @@ export const FleetHubProfile: coreClient.CompositeMapper = { name: "String" } }, + apiServerAccessProfile: { + serializedName: "apiServerAccessProfile", + type: { + name: "Composite", + className: "APIServerAccessProfile" + } + }, + agentProfile: { + serializedName: "agentProfile", + type: { + name: "Composite", + className: "AgentProfile" + } + }, fqdn: { serializedName: "fqdn", readOnly: true, @@ -278,6 +292,110 @@ export const FleetHubProfile: coreClient.CompositeMapper = { } }; +export const APIServerAccessProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "APIServerAccessProfile", + modelProperties: { + enablePrivateCluster: { + serializedName: "enablePrivateCluster", + type: { + name: "Boolean" + } + }, + enableVnetIntegration: { + serializedName: "enableVnetIntegration", + type: { + name: "Boolean" + } + }, + subnetId: { + serializedName: "subnetId", + type: { + name: "String" + } + } + } + } +}; + +export const AgentProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AgentProfile", + modelProperties: { + subnetId: { + serializedName: "subnetId", + type: { + name: "String" + } + } + } + } +}; + +export const ManagedServiceIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ManagedServiceIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + tenantId: { + serializedName: "tenantId", + readOnly: true, + type: { + name: "Uuid" + } + }, + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + }, + userAssignedIdentities: { + serializedName: "userAssignedIdentities", + type: { + name: "Dictionary", + value: { + type: { name: "Composite", className: "UserAssignedIdentity" } + } + } + } + } + } +}; + +export const UserAssignedIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "UserAssignedIdentity", + modelProperties: { + principalId: { + serializedName: "principalId", + readOnly: true, + type: { + name: "Uuid" + } + }, + clientId: { + serializedName: "clientId", + readOnly: true, + type: { + name: "Uuid" + } + } + } + } +}; + export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -371,6 +489,13 @@ export const FleetPatch: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "String" } } } + }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } } } } @@ -590,6 +715,13 @@ export const ManagedClusterUpdate: coreClient.CompositeMapper = { name: "Composite", className: "ManagedClusterUpgradeSpec" } + }, + nodeImageSelection: { + serializedName: "nodeImageSelection", + type: { + name: "Composite", + className: "NodeImageSelection" + } } } } @@ -617,6 +749,22 @@ export const ManagedClusterUpgradeSpec: coreClient.CompositeMapper = { } }; +export const NodeImageSelection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NodeImageSelection", + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } + } + } + } +}; + export const UpdateRunStatus: coreClient.CompositeMapper = { type: { name: "Composite", @@ -641,6 +789,13 @@ export const UpdateRunStatus: coreClient.CompositeMapper = { } } } + }, + nodeImageSelection: { + serializedName: "nodeImageSelection", + type: { + name: "Composite", + className: "NodeImageSelectionStatus" + } } } } @@ -794,6 +949,13 @@ export const MemberUpdateStatus: coreClient.CompositeMapper = { type: { name: "String" } + }, + message: { + serializedName: "message", + readOnly: true, + type: { + name: "String" + } } } } @@ -822,6 +984,72 @@ export const WaitStatus: coreClient.CompositeMapper = { } }; +export const NodeImageSelectionStatus: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "NodeImageSelectionStatus", + modelProperties: { + selectedNodeImageVersions: { + serializedName: "selectedNodeImageVersions", + readOnly: true, + 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" + } + } + } + } +}; + +export const FleetUpdateStrategyListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetUpdateStrategyListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FleetUpdateStrategy" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -869,6 +1097,13 @@ export const Fleet: coreClient.CompositeMapper = { name: "String" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -948,6 +1183,12 @@ export const UpdateRun: coreClient.CompositeMapper = { name: "String" } }, + updateStrategyId: { + serializedName: "properties.updateStrategyId", + type: { + name: "String" + } + }, strategy: { serializedName: "properties.strategy", type: { @@ -973,6 +1214,37 @@ export const UpdateRun: coreClient.CompositeMapper = { } }; +export const FleetUpdateStrategy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetUpdateStrategy", + modelProperties: { + ...ProxyResource.type.modelProperties, + eTag: { + serializedName: "eTag", + readOnly: true, + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + strategy: { + serializedName: "properties.strategy", + type: { + name: "Composite", + className: "UpdateRunStrategy" + } + } + } + } +}; + export const FleetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -988,6 +1260,27 @@ export const FleetsCreateOrUpdateHeaders: coreClient.CompositeMapper = { } }; +export const FleetsUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetsUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const FleetsDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1024,6 +1317,27 @@ export const FleetMembersCreateHeaders: coreClient.CompositeMapper = { } }; +export const FleetMembersUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetMembersUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const FleetMembersDeleteHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1122,3 +1436,39 @@ export const UpdateRunsStopHeaders: coreClient.CompositeMapper = { } } }; + +export const FleetUpdateStrategiesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetUpdateStrategiesCreateOrUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + } + } + } +}; + +export const FleetUpdateStrategiesDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FleetUpdateStrategiesDeleteHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts b/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts index 9d8bfab4b8f0..e10314f461ae 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/models/parameters.ts @@ -16,7 +16,8 @@ import { FleetPatch as FleetPatchMapper, FleetMember as FleetMemberMapper, FleetMemberUpdate as FleetMemberUpdateMapper, - UpdateRun as UpdateRunMapper + UpdateRun as UpdateRunMapper, + FleetUpdateStrategy as FleetUpdateStrategyMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -46,7 +47,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-03-15-preview", + defaultValue: "2023-08-15-preview", isConstant: true, serializedName: "api-version", type: { @@ -200,3 +201,24 @@ export const resource2: OperationParameter = { parameterPath: "resource", mapper: UpdateRunMapper }; + +export const updateStrategyName: OperationURLParameter = { + parameterPath: "updateStrategyName", + mapper: { + constraints: { + Pattern: new RegExp("^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"), + MaxLength: 50, + MinLength: 1 + }, + serializedName: "updateStrategyName", + required: true, + type: { + name: "String" + } + } +}; + +export const resource3: OperationParameter = { + parameterPath: "resource", + mapper: FleetUpdateStrategyMapper +}; diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts index b1de5866886b..fcad582fdbfc 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetMembers.ts @@ -279,17 +279,103 @@ export class FleetMembersImpl implements FleetMembers { * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + async beginUpdate( + resourceGroupName: string, + fleetName: string, + fleetMemberName: string, + properties: FleetMemberUpdate, + options?: FleetMembersUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FleetMembersUpdateResponse + > + > { + 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, + fleetMemberName, + properties, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + FleetMembersUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Update a FleetMember + * @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 properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( resourceGroupName: string, fleetName: string, fleetMemberName: string, properties: FleetMemberUpdate, options?: FleetMembersUpdateOptionalParams ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, fleetMemberName, properties, options }, - updateOperationSpec + const poller = await this.beginUpdate( + resourceGroupName, + fleetName, + fleetMemberName, + properties, + options ); + return poller.pollUntilDone(); } /** @@ -494,6 +580,15 @@ const updateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.FleetMember }, + 201: { + bodyMapper: Mappers.FleetMember + }, + 202: { + bodyMapper: Mappers.FleetMember + }, + 204: { + bodyMapper: Mappers.FleetMember + }, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts new file mode 100644 index 000000000000..4252a83e3216 --- /dev/null +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/fleetUpdateStrategies.ts @@ -0,0 +1,509 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { FleetUpdateStrategies } 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 { + FleetUpdateStrategy, + FleetUpdateStrategiesListByFleetNextOptionalParams, + FleetUpdateStrategiesListByFleetOptionalParams, + FleetUpdateStrategiesListByFleetResponse, + FleetUpdateStrategiesGetOptionalParams, + FleetUpdateStrategiesGetResponse, + FleetUpdateStrategiesCreateOrUpdateOptionalParams, + FleetUpdateStrategiesCreateOrUpdateResponse, + FleetUpdateStrategiesDeleteOptionalParams, + FleetUpdateStrategiesListByFleetNextResponse +} from "../models"; + +/// +/** Class containing FleetUpdateStrategies operations. */ +export class FleetUpdateStrategiesImpl implements FleetUpdateStrategies { + private readonly client: ContainerServiceFleetClient; + + /** + * Initialize a new instance of the class FleetUpdateStrategies class. + * @param client Reference to the service client + */ + constructor(client: ContainerServiceFleetClient) { + this.client = client; + } + + /** + * List FleetUpdateStrategy 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?: FleetUpdateStrategiesListByFleetOptionalParams + ): 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?: FleetUpdateStrategiesListByFleetOptionalParams, + settings?: PageSettings + ): AsyncIterableIterator { + let result: FleetUpdateStrategiesListByFleetResponse; + 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?: FleetUpdateStrategiesListByFleetOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByFleetPagingPage( + resourceGroupName, + fleetName, + options + )) { + yield* page; + } + } + + /** + * List FleetUpdateStrategy 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?: FleetUpdateStrategiesListByFleetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fleetName, options }, + listByFleetOperationSpec + ); + } + + /** + * Get a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, fleetName, updateStrategyName, options }, + getOperationSpec + ); + } + + /** + * Create a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdate( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + resource: FleetUpdateStrategy, + options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FleetUpdateStrategiesCreateOrUpdateResponse + > + > { + 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, + updateStrategyName, + resource, + options + }, + spec: createOrUpdateOperationSpec + }); + const poller = await createHttpPoller< + FleetUpdateStrategiesCreateOrUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Create a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + resource: FleetUpdateStrategy, + options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + fleetName, + updateStrategyName, + resource, + options + ); + return poller.pollUntilDone(); + } + + /** + * Delete a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + async beginDelete( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesDeleteOptionalParams + ): Promise, void>> { + 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, updateStrategyName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "azure-async-operation" + }); + await poller.poll(); + return poller; + } + + /** + * Delete a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + fleetName, + updateStrategyName, + 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?: FleetUpdateStrategiesListByFleetNextOptionalParams + ): 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}/updateStrategies", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FleetUpdateStrategyListResult + }, + 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}/updateStrategies/{updateStrategyName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FleetUpdateStrategy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.updateStrategyName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateStrategies/{updateStrategyName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.FleetUpdateStrategy + }, + 201: { + bodyMapper: Mappers.FleetUpdateStrategy + }, + 202: { + bodyMapper: Mappers.FleetUpdateStrategy + }, + 204: { + bodyMapper: Mappers.FleetUpdateStrategy + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.resource3, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.updateStrategyName + ], + 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}/updateStrategies/{updateStrategyName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.fleetName, + Parameters.updateStrategyName + ], + headerParameters: [Parameters.accept, Parameters.ifMatch], + serializer +}; +const listByFleetNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FleetUpdateStrategyListResult + }, + 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/fleets.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/fleets.ts index fb8f3cae99dd..baf97589a8d1 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/fleets.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/fleets.ts @@ -325,16 +325,90 @@ export class FleetsImpl implements Fleets { * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + async beginUpdate( + resourceGroupName: string, + fleetName: string, + properties: FleetPatch, + options?: FleetsUpdateOptionalParams + ): Promise< + SimplePollerLike, FleetsUpdateResponse> + > { + 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, properties, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + FleetsUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Update a Fleet + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + async beginUpdateAndWait( resourceGroupName: string, fleetName: string, properties: FleetPatch, options?: FleetsUpdateOptionalParams ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, fleetName, properties, options }, - updateOperationSpec + const poller = await this.beginUpdate( + resourceGroupName, + fleetName, + properties, + options ); + return poller.pollUntilDone(); } /** @@ -578,6 +652,15 @@ const updateOperationSpec: coreClient.OperationSpec = { 200: { bodyMapper: Mappers.Fleet }, + 201: { + bodyMapper: Mappers.Fleet + }, + 202: { + bodyMapper: Mappers.Fleet + }, + 204: { + bodyMapper: Mappers.Fleet + }, default: { bodyMapper: Mappers.ErrorResponse } diff --git a/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts b/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts index c3bd93002e47..6f4281d1da5b 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operations/index.ts @@ -10,3 +10,4 @@ export * from "./operations"; export * from "./fleets"; export * from "./fleetMembers"; export * from "./updateRuns"; +export * from "./fleetUpdateStrategies"; diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetMembers.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetMembers.ts index 7cf2be2b780a..1730756c6cda 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetMembers.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetMembers.ts @@ -91,7 +91,27 @@ export interface FleetMembers { * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + beginUpdate( + resourceGroupName: string, + fleetName: string, + fleetMemberName: string, + properties: FleetMemberUpdate, + options?: FleetMembersUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FleetMembersUpdateResponse + > + >; + /** + * Update a FleetMember + * @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 properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( resourceGroupName: string, fleetName: string, fleetMemberName: string, diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetUpdateStrategies.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetUpdateStrategies.ts new file mode 100644 index 000000000000..911652d7bbdf --- /dev/null +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleetUpdateStrategies.ts @@ -0,0 +1,109 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { + FleetUpdateStrategy, + FleetUpdateStrategiesListByFleetOptionalParams, + FleetUpdateStrategiesGetOptionalParams, + FleetUpdateStrategiesGetResponse, + FleetUpdateStrategiesCreateOrUpdateOptionalParams, + FleetUpdateStrategiesCreateOrUpdateResponse, + FleetUpdateStrategiesDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a FleetUpdateStrategies. */ +export interface FleetUpdateStrategies { + /** + * List FleetUpdateStrategy 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?: FleetUpdateStrategiesListByFleetOptionalParams + ): PagedAsyncIterableIterator; + /** + * Get a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesGetOptionalParams + ): Promise; + /** + * Create a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdate( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + resource: FleetUpdateStrategy, + options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams + ): Promise< + SimplePollerLike< + OperationState, + FleetUpdateStrategiesCreateOrUpdateResponse + > + >; + /** + * Create a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param resource Resource create parameters. + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + resource: FleetUpdateStrategy, + options?: FleetUpdateStrategiesCreateOrUpdateOptionalParams + ): Promise; + /** + * Delete a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + beginDelete( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesDeleteOptionalParams + ): Promise, void>>; + /** + * Delete a FleetUpdateStrategy + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param updateStrategyName The name of the UpdateStrategy resource. + * @param options The options parameters. + */ + beginDeleteAndWait( + resourceGroupName: string, + fleetName: string, + updateStrategyName: string, + options?: FleetUpdateStrategiesDeleteOptionalParams + ): Promise; +} diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleets.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleets.ts index aa62c917c55d..1ca016e16c59 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleets.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/fleets.ts @@ -92,7 +92,22 @@ export interface Fleets { * @param properties The resource properties to be updated. * @param options The options parameters. */ - update( + beginUpdate( + resourceGroupName: string, + fleetName: string, + properties: FleetPatch, + options?: FleetsUpdateOptionalParams + ): Promise< + SimplePollerLike, FleetsUpdateResponse> + >; + /** + * Update a Fleet + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName The name of the Fleet resource. + * @param properties The resource properties to be updated. + * @param options The options parameters. + */ + beginUpdateAndWait( resourceGroupName: string, fleetName: string, properties: FleetPatch, diff --git a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts index c3bd93002e47..6f4281d1da5b 100644 --- a/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts +++ b/sdk/containerservice/arm-containerservicefleet/src/operationsInterfaces/index.ts @@ -10,3 +10,4 @@ export * from "./operations"; export * from "./fleets"; 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..25aeb3ebcc36 --- /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"