diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 15e15ca9c583..496ebe8465d1 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -734,6 +734,7 @@ packages: /@azure/ai-form-recognizer/3.1.0-beta.3: resolution: {integrity: sha512-+4QtFKNyxAmdqpcYjuAtmWKm/MuOe9kZsbpS9jA9h0YHzngNj5gc67AA4egV9BXOq9x+1phjYTNC/rxiOUr1uQ==} engines: {node: '>=8.0.0'} + deprecated: Please migrate to a supported (non-beta) version of this package dependencies: '@azure/core-auth': 1.4.0 '@azure/core-http': 1.2.6 @@ -3935,7 +3936,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.1.0-dev.20230402 + typescript: 5.1.0-dev.20230403 dev: false /ecdsa-sig-formatter/1.0.11: @@ -8783,8 +8784,8 @@ packages: hasBin: true dev: false - /typescript/5.1.0-dev.20230402: - resolution: {integrity: sha512-YivJhKi6iTmS5qfkSuv/p1NYZtlQLexIHIF25kXxYkpjcs6jEtbLEctviQYTrzGVMq+R0QCTRW5EQtp+NLwtnA==} + /typescript/5.1.0-dev.20230403: + resolution: {integrity: sha512-13wAf5PQCHJI5dJ945XBEp+63KzXWkazC4glwfzp1ODLQYVWUnHA6trbCpsMIQfvmiaNmzqRmpSrIqaWppST4g==} engines: {node: '>=12.20'} hasBin: true dev: false @@ -14141,7 +14142,7 @@ packages: dev: false file:projects/arm-redisenterprisecache.tgz: - resolution: {integrity: sha512-o8B5iF+Rc7q4q92jN816MtGPqJZ8m4dDjYcGX56X2npc+BsRMjyWpJCQf9lt2gdPJUtprmSdsIHox9/BQfaL9g==, tarball: file:projects/arm-redisenterprisecache.tgz} + resolution: {integrity: sha512-mSc4WLd+qV4PfRj3KnsiAHVT1ppEf6lFB3lL5DQIhOGG9A77EDfM0SqVqSVirhXE0kjg5nz/OEkVW+GbLANO0A==, tarball: file:projects/arm-redisenterprisecache.tgz} name: '@rush-temp/arm-redisenterprisecache' version: 0.0.0 dependencies: @@ -14155,7 +14156,8 @@ packages: '@types/node': 14.18.41 chai: 4.3.7 cross-env: 7.0.3 - mkdirp: 1.0.4 + dotenv: 16.0.3 + mkdirp: 2.1.6 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 diff --git a/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md b/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md index f606c90dcf3e..7257046d98df 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md +++ b/sdk/redisenterprise/arm-redisenterprisecache/CHANGELOG.md @@ -1,15 +1,50 @@ # Release History + +## 3.0.0-beta.1 (2023-04-03) + +**Features** -## 2.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group Skus + - Added operation Databases.beginFlush + - Added operation Databases.beginFlushAndWait + - Added operation PrivateEndpointConnections.beginDelete + - Added operation PrivateEndpointConnections.beginDeleteAndWait + - Added Interface Capability + - Added Interface ClusterPropertiesEncryption + - Added Interface ClusterPropertiesEncryptionCustomerManagedKeyEncryption + - Added Interface ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity + - Added Interface DatabasesFlushHeaders + - Added Interface DatabasesFlushOptionalParams + - Added Interface FlushParameters + - Added Interface LocationInfo + - Added Interface ManagedServiceIdentity + - Added Interface PrivateEndpointConnectionsDeleteHeaders + - Added Interface RegionSkuDetail + - Added Interface RegionSkuDetails + - Added Interface SkuDetail + - Added Interface SkusListOptionalParams + - Added Interface SystemData + - Added Interface UserAssignedIdentity + - Added Type Alias CmkIdentityType + - Added Type Alias CreatedByType + - Added Type Alias ManagedServiceIdentityType + - Added Type Alias SkusListResponse + - Interface Cluster has a new optional parameter encryption + - Interface Cluster has a new optional parameter identity + - Interface ClusterUpdate has a new optional parameter encryption + - Interface ClusterUpdate has a new optional parameter identity + - Interface PrivateEndpointConnectionsDeleteOptionalParams has a new optional parameter resumeFrom + - Interface PrivateEndpointConnectionsDeleteOptionalParams has a new optional parameter updateIntervalInMs + - Interface Resource has a new optional parameter systemData + - Added Enum KnownCmkIdentityType + - Added Enum KnownCreatedByType + - Added Enum KnownManagedServiceIdentityType -### Other Changes +**Breaking Changes** + - Removed operation PrivateEndpointConnections.delete + + ## 2.2.0 (2022-12-07) **Features** diff --git a/sdk/redisenterprise/arm-redisenterprisecache/LICENSE b/sdk/redisenterprise/arm-redisenterprisecache/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/LICENSE +++ b/sdk/redisenterprise/arm-redisenterprisecache/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/redisenterprise/arm-redisenterprisecache/README.md b/sdk/redisenterprise/arm-redisenterprisecache/README.md index 06757599b3f5..dafc2f91a1b8 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/README.md +++ b/sdk/redisenterprise/arm-redisenterprisecache/README.md @@ -6,7 +6,7 @@ REST API for managing Redis Enterprise resources in Azure. [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-redisenterprisecache) | -[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started diff --git a/sdk/redisenterprise/arm-redisenterprisecache/_meta.json b/sdk/redisenterprise/arm-redisenterprisecache/_meta.json index c28c75b21dd3..c05764296e51 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/_meta.json +++ b/sdk/redisenterprise/arm-redisenterprisecache/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d2122bd6c18c0e76f33e522288567c51ddfbc205", + "commit": "9b7ef7479f663302068436becc27dc7b47cf2b9b", "readme": "specification/redisenterprise/resource-manager/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=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\redisenterprise\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.4 --generate-sample=true", + "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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/redisenterprise/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.10", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", - "use": "@autorest/typescript@6.0.0-rc.4" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", + "use": "@autorest/typescript@6.0.0-rc.10" } \ No newline at end of file diff --git a/sdk/redisenterprise/arm-redisenterprisecache/package.json b/sdk/redisenterprise/arm-redisenterprisecache/package.json index 2ed706039bba..12dedbb9b580 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/package.json +++ b/sdk/redisenterprise/arm-redisenterprisecache/package.json @@ -3,15 +3,15 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for RedisEnterpriseManagementClient.", - "version": "2.2.1", + "version": "3.0.0-beta.1", "engines": { "node": ">=14.0.0" }, "dependencies": { - "@azure/core-lro": "^2.2.0", + "@azure/core-lro": "^2.5.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.6.1", + "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -33,12 +33,13 @@ "@rollup/plugin-json": "^6.0.0", "@rollup/plugin-multi-entry": "^6.0.0", "@rollup/plugin-node-resolve": "^13.1.3", - "mkdirp": "^1.0.4", + "mkdirp": "^2.1.2", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^16.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -49,7 +50,6 @@ "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,12 +111,5 @@ ] }, "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-redisenterprisecache?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redisenterprise/arm-redisenterprisecache" +} \ No newline at end of file diff --git a/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md b/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md index 925aa738ae93..51c9339c629d 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md +++ b/sdk/redisenterprise/arm-redisenterprisecache/review/arm-redisenterprisecache.api.md @@ -6,9 +6,9 @@ import * as coreAuth from '@azure/core-auth'; import * as coreClient from '@azure/core-client'; +import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { PollerLike } from '@azure/core-lro'; -import { PollOperationState } from '@azure/core-lro'; +import { SimplePollerLike } from '@azure/core-lro'; // @public export interface AccessKeys { @@ -25,9 +25,17 @@ export type ActionType = string; // @public export type AofFrequency = string; +// @public +export interface Capability { + name?: string; + value?: boolean; +} + // @public export interface Cluster extends TrackedResource { + encryption?: ClusterPropertiesEncryption; readonly hostName?: string; + identity?: ManagedServiceIdentity; minimumTlsVersion?: TlsVersion; readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; @@ -46,9 +54,28 @@ export interface ClusterList { value?: Cluster[]; } +// @public +export interface ClusterPropertiesEncryption { + customerManagedKeyEncryption?: ClusterPropertiesEncryptionCustomerManagedKeyEncryption; +} + +// @public +export interface ClusterPropertiesEncryptionCustomerManagedKeyEncryption { + keyEncryptionKeyIdentity?: ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; + keyEncryptionKeyUrl?: string; +} + +// @public +export interface ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity { + identityType?: CmkIdentityType; + userAssignedIdentityResourceId?: string; +} + // @public export interface ClusterUpdate { + encryption?: ClusterPropertiesEncryption; readonly hostName?: string; + identity?: ManagedServiceIdentity; minimumTlsVersion?: TlsVersion; readonly privateEndpointConnections?: PrivateEndpointConnection[]; readonly provisioningState?: ProvisioningState; @@ -60,6 +87,12 @@ export interface ClusterUpdate { }; } +// @public +export type CmkIdentityType = string; + +// @public +export type CreatedByType = string; + // @public export interface Database extends ProxyResource { clientProtocol?: Protocol; @@ -87,19 +120,21 @@ export interface DatabasePropertiesGeoReplication { // @public export interface Databases { - beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise, DatabasesCreateResponse>>; + beginCreate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise, DatabasesCreateResponse>>; beginCreateAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: Database, options?: DatabasesCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams): Promise; - beginExport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise, void>>; + beginExport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise, void>>; beginExportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams): Promise; - beginForceUnlink(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams): Promise, void>>; + beginFlush(resourceGroupName: string, clusterName: string, databaseName: string, parameters: FlushParameters, options?: DatabasesFlushOptionalParams): Promise, void>>; + beginFlushAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: FlushParameters, options?: DatabasesFlushOptionalParams): Promise; + beginForceUnlink(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams): Promise, void>>; beginForceUnlinkAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams): Promise; - beginImport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise, void>>; + beginImport(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise, void>>; beginImportAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams): Promise; - beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise, DatabasesRegenerateKeyResponse>>; + beginRegenerateKey(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise, DatabasesRegenerateKeyResponse>>; beginRegenerateKeyAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams): Promise; - beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams): Promise, DatabasesUpdateResponse>>; + beginUpdate(resourceGroupName: string, clusterName: string, databaseName: string, parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams): Promise, DatabasesUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, clusterName: string, databaseName: string, parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, databaseName: string, options?: DatabasesGetOptionalParams): Promise; listByCluster(resourceGroupName: string, clusterName: string, options?: DatabasesListByClusterOptionalParams): PagedAsyncIterableIterator; @@ -127,6 +162,18 @@ export interface DatabasesExportOptionalParams extends coreClient.OperationOptio updateIntervalInMs?: number; } +// @public +export interface DatabasesFlushHeaders { + azureAsyncOperation?: string; + location?: string; +} + +// @public +export interface DatabasesFlushOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + // @public export interface DatabasesForceUnlinkOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -226,6 +273,11 @@ export interface ExportClusterParameters { sasUri: string; } +// @public +export interface FlushParameters { + ids?: string[]; +} + // @public export interface ForceUnlinkParameters { ids: string[]; @@ -256,6 +308,20 @@ export enum KnownClusteringPolicy { OSSCluster = "OSSCluster" } +// @public +export enum KnownCmkIdentityType { + SystemAssignedIdentity = "systemAssignedIdentity", + UserAssignedIdentity = "userAssignedIdentity" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + // @public export enum KnownEvictionPolicy { AllKeysLFU = "AllKeysLFU", @@ -277,6 +343,14 @@ export enum KnownLinkState { Unlinking = "Unlinking" } +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + // @public export enum KnownOrigin { System = "system", @@ -365,6 +439,25 @@ export interface LinkedDatabase { // @public export type LinkState = string; +// @public +export interface LocationInfo { + capabilities?: Capability[]; + location?: 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 Module { args?: string; @@ -469,15 +562,24 @@ export type PrivateEndpointConnectionProvisioningState = string; // @public export interface PrivateEndpointConnections { - beginPut(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; + beginDelete(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise, void>>; + beginDeleteAndWait(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + beginPut(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; beginPutAndWait(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise; - delete(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; list(resourceGroupName: string, clusterName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface PrivateEndpointConnectionsDeleteHeaders { + azureAsyncOperation?: string; + location?: string; +} + // @public export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public @@ -552,11 +654,11 @@ export type RdbFrequency = string; // @public export interface RedisEnterprise { - beginCreate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams): Promise, RedisEnterpriseCreateResponse>>; + beginCreate(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams): Promise, RedisEnterpriseCreateResponse>>; beginCreateAndWait(resourceGroupName: string, clusterName: string, parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams): Promise, void>>; + beginDelete(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams): Promise, void>>; beginDeleteAndWait(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams): Promise; - beginUpdate(resourceGroupName: string, clusterName: string, parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams): Promise, RedisEnterpriseUpdateResponse>>; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams): Promise, RedisEnterpriseUpdateResponse>>; beginUpdateAndWait(resourceGroupName: string, clusterName: string, parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams): Promise; get(resourceGroupName: string, clusterName: string, options?: RedisEnterpriseGetOptionalParams): Promise; list(options?: RedisEnterpriseListOptionalParams): PagedAsyncIterableIterator; @@ -633,6 +735,8 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { // (undocumented) redisEnterprise: RedisEnterprise; // (undocumented) + skus: Skus; + // (undocumented) subscriptionId: string; } @@ -657,10 +761,23 @@ export interface RegenerateKeyParameters { keyType: AccessKeyType; } +// @public +export interface RegionSkuDetail { + locationInfo?: LocationInfo; + resourceType?: string; + skuDetails?: SkuDetail; +} + +// @public +export interface RegionSkuDetails { + value?: RegionSkuDetail[]; +} + // @public export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } @@ -673,9 +790,36 @@ export interface Sku { name: SkuName; } +// @public +export interface SkuDetail { + name?: SkuName; +} + // @public export type SkuName = string; +// @public +export interface Skus { + list(location: string, options?: SkusListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface SkusListOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type SkusListResponse = RegionSkuDetails; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + // @public export type TlsVersion = string; @@ -687,6 +831,12 @@ export interface TrackedResource extends Resource { }; } +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts index 518d5f053b4e..dd803cd5e28c 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/lroImpl.ts @@ -6,29 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; -export class LroImpl implements LongRunningOperation { - constructor( - private sendOperationFn: (args: any, spec: any) => Promise>, - private args: Record, - private spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record, - public requestPath: string = spec.path!, - public requestMethod: string = spec.httpMethod - ) {} - public async sendInitialRequest(): Promise> { - return this.sendOperationFn(this.args, this.spec); - } - public async sendPollRequest(path: string): Promise> { - const { requestBody, ...restSpec } = this.spec; - return this.sendOperationFn(this.args, { - ...restSpec, - path, - httpMethod: "GET" - }); - } +export function createLroSpec(inputs: { + sendOperationFn: (args: any, spec: any) => Promise>; + args: Record; + spec: { + readonly requestBody?: unknown; + readonly path?: string; + readonly httpMethod: string; + } & Record; +}): LongRunningOperation { + const { args, spec, sendOperationFn } = inputs; + return { + requestMethod: spec.httpMethod, + requestPath: spec.path!, + sendInitialRequest: () => sendOperationFn(args, spec), + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike } + ) => { + const { requestBody, ...restSpec } = spec; + return sendOperationFn(args, { + ...restSpec, + httpMethod: "GET", + path, + abortSignal: options?.abortSignal + }); + } + }; } diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts index 008564f03f2a..00028503eda4 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/index.ts @@ -145,6 +145,60 @@ export interface Sku { capacity?: number; } +/** 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; +} + +/** Encryption-at-rest configuration for the cluster. */ +export interface ClusterPropertiesEncryption { + /** All Customer-managed key encryption properties for the resource. Set this to an empty object to use Microsoft-managed key encryption. */ + customerManagedKeyEncryption?: ClusterPropertiesEncryptionCustomerManagedKeyEncryption; +} + +/** All Customer-managed key encryption properties for the resource. Set this to an empty object to use Microsoft-managed key encryption. */ +export interface ClusterPropertiesEncryptionCustomerManagedKeyEncryption { + /** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */ + keyEncryptionKeyIdentity?: ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity; + /** Key encryption key Url, versioned only. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 */ + keyEncryptionKeyUrl?: string; +} + +/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */ +export interface ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity { + /** User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. */ + userAssignedIdentityResourceId?: string; + /** Only userAssignedIdentity is supported in this API version; other types may be supported in the future */ + identityType?: CmkIdentityType; +} + /** The Private Endpoint resource. */ export interface PrivateEndpoint { /** @@ -181,16 +235,41 @@ export interface Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly type?: string; + /** + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly systemData?: SystemData; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } /** A partial update to the RedisEnterprise cluster */ export interface ClusterUpdate { /** The SKU to create, which affects price, performance, and features. */ sku?: Sku; + /** The identity of the resource. */ + identity?: ManagedServiceIdentity; /** Resource tags. */ tags?: { [propertyName: string]: string }; /** The minimum TLS version for the cluster to support, e.g. '1.2' */ minimumTlsVersion?: TlsVersion; + /** Encryption-at-rest configuration for the cluster. */ + encryption?: ClusterPropertiesEncryption; /** * DNS name of the cluster endpoint * NOTE: This property will not be serialized. It can only be populated by the server. @@ -362,6 +441,50 @@ export interface ForceUnlinkParameters { ids: string[]; } +/** Parameters for a Redis Enterprise active geo-replication flush operation. */ +export interface FlushParameters { + /** The resource identifiers of all the other database resources in the georeplication group to be flushed */ + ids?: string[]; +} + +/** List of details about all the available SKUs */ +export interface RegionSkuDetails { + /** List of Sku Detail */ + value?: RegionSkuDetail[]; +} + +/** Details about the location requested and the available skus in the location */ +export interface RegionSkuDetail { + /** Resource type which has the SKU, such as Microsoft.Cache/redisEnterprise */ + resourceType?: string; + /** Details about location and its capabilities */ + locationInfo?: LocationInfo; + /** Details about available skus */ + skuDetails?: SkuDetail; +} + +/** Information about location (for example: features that it supports) */ +export interface LocationInfo { + /** Location name */ + location?: string; + /** List of capabilities */ + capabilities?: Capability[]; +} + +/** Information about the features the location supports */ +export interface Capability { + /** Feature name */ + name?: string; + /** Indicates whether feature is supported or not */ + value?: boolean; +} + +/** Information about Sku */ +export interface SkuDetail { + /** The type of RedisEnterprise cluster to deploy. Possible values: (Enterprise_E10, EnterpriseFlash_F300 etc.) */ + name?: SkuName; +} + /** The Private Endpoint Connection resource. */ export interface PrivateEndpointConnection extends Resource { /** The resource of private end point. */ @@ -408,8 +531,12 @@ export interface Cluster extends TrackedResource { sku: Sku; /** The Availability Zones where this cluster will be deployed. */ zones?: string[]; + /** The identity of the resource. */ + identity?: ManagedServiceIdentity; /** The minimum TLS version for the cluster to support, e.g. '1.2' */ minimumTlsVersion?: TlsVersion; + /** Encryption-at-rest configuration for the cluster. */ + encryption?: ClusterPropertiesEncryption; /** * DNS name of the cluster endpoint * NOTE: This property will not be serialized. It can only be populated by the server. @@ -465,6 +592,22 @@ export interface Database extends ProxyResource { geoReplication?: DatabasePropertiesGeoReplication; } +/** Defines headers for Databases_flush operation. */ +export interface DatabasesFlushHeaders { + /** Location URI to poll for result */ + location?: string; + /** URI to poll for the operation status */ + azureAsyncOperation?: string; +} + +/** Defines headers for PrivateEndpointConnections_delete operation. */ +export interface PrivateEndpointConnectionsDeleteHeaders { + /** Location URI to poll for result */ + location?: string; + /** URI to poll for the operation status */ + azureAsyncOperation?: string; +} + /** Known values of {@link Origin} that the service accepts. */ export enum KnownOrigin { /** User */ @@ -534,6 +677,30 @@ export enum KnownSkuName { */ export type SkuName = 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 TlsVersion} that the service accepts. */ export enum KnownTlsVersion { /** One0 */ @@ -555,6 +722,24 @@ export enum KnownTlsVersion { */ export type TlsVersion = string; +/** Known values of {@link CmkIdentityType} that the service accepts. */ +export enum KnownCmkIdentityType { + /** SystemAssignedIdentity */ + SystemAssignedIdentity = "systemAssignedIdentity", + /** UserAssignedIdentity */ + UserAssignedIdentity = "userAssignedIdentity" +} + +/** + * Defines values for CmkIdentityType. \ + * {@link KnownCmkIdentityType} can be used interchangeably with CmkIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **systemAssignedIdentity** \ + * **userAssignedIdentity** + */ +export type CmkIdentityType = string; + /** Known values of {@link ProvisioningState} that the service accepts. */ export enum KnownProvisioningState { /** Succeeded */ @@ -678,6 +863,30 @@ export enum KnownPrivateEndpointConnectionProvisioningState { */ export type PrivateEndpointConnectionProvisioningState = string; +/** Known values of {@link CreatedByType} that the service accepts. */ +export enum KnownCreatedByType { + /** User */ + User = "User", + /** Application */ + Application = "Application", + /** ManagedIdentity */ + ManagedIdentity = "ManagedIdentity", + /** Key */ + Key = "Key" +} + +/** + * Defines values for CreatedByType. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User** \ + * **Application** \ + * **ManagedIdentity** \ + * **Key** + */ +export type CreatedByType = string; + /** Known values of {@link Protocol} that the service accepts. */ export enum KnownProtocol { /** Encrypted */ @@ -1000,6 +1209,15 @@ export interface DatabasesForceUnlinkOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface DatabasesFlushOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} + /** Optional parameters. */ export interface DatabasesListByClusterNextOptionalParams extends coreClient.OperationOptions {} @@ -1035,7 +1253,12 @@ export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection; /** Optional parameters. */ export interface PrivateEndpointConnectionsDeleteOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Optional parameters. */ export interface PrivateLinkResourcesListByClusterOptionalParams @@ -1044,6 +1267,12 @@ export interface PrivateLinkResourcesListByClusterOptionalParams /** Contains response data for the listByCluster operation. */ export type PrivateLinkResourcesListByClusterResponse = PrivateLinkResourceListResult; +/** Optional parameters. */ +export interface SkusListOptionalParams extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type SkusListResponse = RegionSkuDetails; + /** Optional parameters. */ export interface RedisEnterpriseManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts index 7e9608ab2454..9875b0e339ba 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/mappers.ts @@ -282,6 +282,129 @@ export const Sku: coreClient.CompositeMapper = { } }; +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 ClusterPropertiesEncryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterPropertiesEncryption", + modelProperties: { + customerManagedKeyEncryption: { + serializedName: "customerManagedKeyEncryption", + type: { + name: "Composite", + className: "ClusterPropertiesEncryptionCustomerManagedKeyEncryption" + } + } + } + } +}; + +export const ClusterPropertiesEncryptionCustomerManagedKeyEncryption: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClusterPropertiesEncryptionCustomerManagedKeyEncryption", + modelProperties: { + keyEncryptionKeyIdentity: { + serializedName: "keyEncryptionKeyIdentity", + type: { + name: "Composite", + className: + "ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity" + } + }, + keyEncryptionKeyUrl: { + serializedName: "keyEncryptionKeyUrl", + type: { + name: "String" + } + } + } + } +}; + +export const ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: + "ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity", + modelProperties: { + userAssignedIdentityResourceId: { + serializedName: "userAssignedIdentityResourceId", + type: { + name: "String" + } + }, + identityType: { + serializedName: "identityType", + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpoint: coreClient.CompositeMapper = { type: { name: "Composite", @@ -350,6 +473,58 @@ export const Resource: coreClient.CompositeMapper = { type: { name: "String" } + }, + systemData: { + serializedName: "systemData", + type: { + name: "Composite", + className: "SystemData" + } + } + } + } +}; + +export const SystemData: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SystemData", + modelProperties: { + createdBy: { + serializedName: "createdBy", + type: { + name: "String" + } + }, + createdByType: { + serializedName: "createdByType", + type: { + name: "String" + } + }, + createdAt: { + serializedName: "createdAt", + type: { + name: "DateTime" + } + }, + lastModifiedBy: { + serializedName: "lastModifiedBy", + type: { + name: "String" + } + }, + lastModifiedByType: { + serializedName: "lastModifiedByType", + type: { + name: "String" + } + }, + lastModifiedAt: { + serializedName: "lastModifiedAt", + type: { + name: "DateTime" + } } } } @@ -367,6 +542,13 @@ export const ClusterUpdate: coreClient.CompositeMapper = { className: "Sku" } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, tags: { serializedName: "tags", type: { @@ -380,6 +562,13 @@ export const ClusterUpdate: coreClient.CompositeMapper = { name: "String" } }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "ClusterPropertiesEncryption" + } + }, hostName: { serializedName: "properties.hostName", readOnly: true, @@ -805,6 +994,139 @@ export const ForceUnlinkParameters: coreClient.CompositeMapper = { } }; +export const FlushParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FlushParameters", + modelProperties: { + ids: { + serializedName: "ids", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + } + } + } +}; + +export const RegionSkuDetails: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegionSkuDetails", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "RegionSkuDetail" + } + } + } + } + } + } +}; + +export const RegionSkuDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RegionSkuDetail", + modelProperties: { + resourceType: { + serializedName: "resourceType", + type: { + name: "String" + } + }, + locationInfo: { + serializedName: "locationInfo", + type: { + name: "Composite", + className: "LocationInfo" + } + }, + skuDetails: { + serializedName: "skuDetails", + type: { + name: "Composite", + className: "SkuDetail" + } + } + } + } +}; + +export const LocationInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LocationInfo", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + capabilities: { + serializedName: "capabilities", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Capability" + } + } + } + } + } + } +}; + +export const Capability: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Capability", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + value: { + serializedName: "value", + type: { + name: "Boolean" + } + } + } + } +}; + +export const SkuDetail: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SkuDetail", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + } + } + } +}; + export const PrivateEndpointConnection: coreClient.CompositeMapper = { type: { name: "Composite", @@ -934,12 +1256,26 @@ export const Cluster: coreClient.CompositeMapper = { } } }, + identity: { + serializedName: "identity", + type: { + name: "Composite", + className: "ManagedServiceIdentity" + } + }, minimumTlsVersion: { serializedName: "properties.minimumTlsVersion", type: { name: "String" } }, + encryption: { + serializedName: "properties.encryption", + type: { + name: "Composite", + className: "ClusterPropertiesEncryption" + } + }, hostName: { serializedName: "properties.hostName", readOnly: true, @@ -1058,3 +1394,45 @@ export const Database: coreClient.CompositeMapper = { } } }; + +export const DatabasesFlushHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabasesFlushHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const PrivateEndpointConnectionsDeleteHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnectionsDeleteHeaders", + modelProperties: { + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts index 578c2b61c331..62beffee0ad5 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/models/parameters.ts @@ -20,6 +20,7 @@ import { ImportClusterParameters as ImportClusterParametersMapper, ExportClusterParameters as ExportClusterParametersMapper, ForceUnlinkParameters as ForceUnlinkParametersMapper, + FlushParameters as FlushParametersMapper, PrivateEndpointConnection as PrivateEndpointConnectionMapper } from "../models/mappers"; @@ -50,7 +51,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-01-01", + defaultValue: "2023-03-01-preview", isConstant: true, serializedName: "api-version", type: { @@ -202,6 +203,11 @@ export const parameters7: OperationParameter = { mapper: ForceUnlinkParametersMapper }; +export const parameters8: OperationParameter = { + parameterPath: "parameters", + mapper: FlushParametersMapper +}; + export const privateEndpointConnectionName: OperationURLParameter = { parameterPath: "privateEndpointConnectionName", mapper: { diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts index 25d62f51d443..ccda045aff72 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/databases.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Database, DatabasesListByClusterNextOptionalParams, @@ -39,6 +43,8 @@ import { DatabasesExportOptionalParams, ForceUnlinkParameters, DatabasesForceUnlinkOptionalParams, + FlushParameters, + DatabasesFlushOptionalParams, DatabasesListByClusterNextResponse } from "../models"; @@ -171,8 +177,8 @@ export class DatabasesImpl implements Databases { parameters: Database, options?: DatabasesCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesCreateResponse > > { @@ -182,7 +188,7 @@ export class DatabasesImpl implements Databases { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -215,15 +221,24 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + DatabasesCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -269,8 +284,8 @@ export class DatabasesImpl implements Databases { parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesUpdateResponse > > { @@ -280,7 +295,7 @@ export class DatabasesImpl implements Databases { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -313,15 +328,24 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + DatabasesUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -383,14 +407,14 @@ export class DatabasesImpl implements Databases { clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -423,15 +447,15 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, databaseName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -493,8 +517,8 @@ export class DatabasesImpl implements Databases { parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesRegenerateKeyResponse > > { @@ -504,7 +528,7 @@ export class DatabasesImpl implements Databases { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -537,15 +561,24 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - regenerateKeyOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: regenerateKeyOperationSpec + }); + const poller = await createHttpPoller< + DatabasesRegenerateKeyResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "location" }); await poller.poll(); return poller; @@ -590,14 +623,14 @@ export class DatabasesImpl implements Databases { databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -630,15 +663,21 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - importOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: importOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -683,14 +722,14 @@ export class DatabasesImpl implements Databases { databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -723,15 +762,21 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - exportOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: exportOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -776,14 +821,14 @@ export class DatabasesImpl implements Databases { databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -816,15 +861,21 @@ export class DatabasesImpl implements Databases { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, databaseName, parameters, options }, - forceUnlinkOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { + resourceGroupName, + clusterName, + databaseName, + parameters, + options + }, + spec: forceUnlinkOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -855,6 +906,105 @@ export class DatabasesImpl implements Databases { return poller.pollUntilDone(); } + /** + * Flushes all the keys in this database and also from its linked databases. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the databases to be flushed + * @param options The options parameters. + */ + async beginFlush( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: FlushParameters, + options?: DatabasesFlushOptionalParams + ): 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, + clusterName, + databaseName, + parameters, + options + }, + spec: flushOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Flushes all the keys in this database and also from its linked databases. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the databases to be flushed + * @param options The options parameters. + */ + async beginFlushAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: FlushParameters, + options?: DatabasesFlushOptionalParams + ): Promise { + const poller = await this.beginFlush( + resourceGroupName, + clusterName, + databaseName, + parameters, + options + ); + return poller.pollUntilDone(); + } + /** * ListByClusterNext * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1149,6 +1299,32 @@ const forceUnlinkOperationSpec: coreClient.OperationSpec = { mediaType: "json", serializer }; +const flushOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/flush", + httpMethod: "POST", + responses: { + 200: {}, + 201: {}, + 202: {}, + 204: {}, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + requestBody: Parameters.parameters8, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.clusterName, + Parameters.databaseName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listByClusterNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts index cb8946c7cbcc..408ae886b779 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/index.ts @@ -12,3 +12,4 @@ export * from "./redisEnterprise"; export * from "./databases"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./skus"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts index d17f756e30c3..4651141c1206 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/privateEndpointConnections.ts @@ -12,8 +12,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { PrivateEndpointConnection, PrivateEndpointConnectionsListOptionalParams, @@ -156,8 +160,8 @@ export class PrivateEndpointConnectionsImpl properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsPutResponse > > { @@ -167,7 +171,7 @@ export class PrivateEndpointConnectionsImpl ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -200,19 +204,22 @@ export class PrivateEndpointConnectionsImpl }; }; - const lro = new LroImpl( - sendOperation, - { + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, privateEndpointConnectionName, properties, options }, - putOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + spec: putOperationSpec + }); + const poller = await createHttpPoller< + PrivateEndpointConnectionsPutResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs }); await poller.poll(); @@ -254,21 +261,91 @@ export class PrivateEndpointConnectionsImpl * Azure resource * @param options The options parameters. */ - delete( + async beginDelete( resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams - ): Promise { - return this.client.sendOperationRequest( - { + ): 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, clusterName, privateEndpointConnectionName, options }, - deleteOperationSpec + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + async beginDeleteAndWait( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + clusterName, + privateEndpointConnectionName, + options ); + return poller.pollUntilDone(); } } // Operation Specifications @@ -359,6 +436,8 @@ const deleteOperationSpec: coreClient.OperationSpec = { httpMethod: "DELETE", responses: { 200: {}, + 201: {}, + 202: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts index 55a2806996ba..d758ba6025aa 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/redisEnterprise.ts @@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; -import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; -import { LroImpl } from "../lroImpl"; +import { + SimplePollerLike, + OperationState, + createHttpPoller +} from "@azure/core-lro"; +import { createLroSpec } from "../lroImpl"; import { Cluster, RedisEnterpriseListByResourceGroupNextOptionalParams, @@ -184,8 +188,8 @@ export class RedisEnterpriseImpl implements RedisEnterprise { parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, RedisEnterpriseCreateResponse > > { @@ -195,7 +199,7 @@ export class RedisEnterpriseImpl implements RedisEnterprise { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -228,15 +232,18 @@ export class RedisEnterpriseImpl implements RedisEnterprise { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, parameters, options }, - createOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, parameters, options }, + spec: createOperationSpec + }); + const poller = await createHttpPoller< + RedisEnterpriseCreateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "original-uri" + resourceLocationConfig: "original-uri" }); await poller.poll(); return poller; @@ -277,8 +284,8 @@ export class RedisEnterpriseImpl implements RedisEnterprise { parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, RedisEnterpriseUpdateResponse > > { @@ -288,7 +295,7 @@ export class RedisEnterpriseImpl implements RedisEnterprise { ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -321,15 +328,18 @@ export class RedisEnterpriseImpl implements RedisEnterprise { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, parameters, options }, - updateOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, parameters, options }, + spec: updateOperationSpec + }); + const poller = await createHttpPoller< + RedisEnterpriseUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; @@ -367,14 +377,14 @@ export class RedisEnterpriseImpl implements RedisEnterprise { resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams - ): Promise, void>> { + ): Promise, void>> { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ): Promise => { return this.client.sendOperationRequest(args, spec); }; - const sendOperation = async ( + const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec ) => { @@ -407,15 +417,15 @@ export class RedisEnterpriseImpl implements RedisEnterprise { }; }; - const lro = new LroImpl( - sendOperation, - { resourceGroupName, clusterName, options }, - deleteOperationSpec - ); - const poller = new LroEngine(lro, { - resumeFrom: options?.resumeFrom, + const lro = createLroSpec({ + sendOperationFn, + args: { resourceGroupName, clusterName, options }, + spec: deleteOperationSpec + }); + const poller = await createHttpPoller>(lro, { + restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - lroResourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation" }); await poller.poll(); return poller; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operations/skus.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/skus.ts new file mode 100644 index 000000000000..4319549326a6 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operations/skus.ts @@ -0,0 +1,117 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { Skus } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { RedisEnterpriseManagementClient } from "../redisEnterpriseManagementClient"; +import { + RegionSkuDetail, + SkusListOptionalParams, + SkusListResponse +} from "../models"; + +/// +/** Class containing Skus operations. */ +export class SkusImpl implements Skus { + private readonly client: RedisEnterpriseManagementClient; + + /** + * Initialize a new instance of the class Skus class. + * @param client Reference to the service client + */ + constructor(client: RedisEnterpriseManagementClient) { + this.client = client; + } + + /** + * Gets information about skus in specified location for the given subscription id + * @param location The name of Azure region. + * @param options The options parameters. + */ + public list( + location: string, + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listPagingAll(location, 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.listPagingPage(location, options, settings); + } + }; + } + + private async *listPagingPage( + location: string, + options?: SkusListOptionalParams, + _settings?: PageSettings + ): AsyncIterableIterator { + let result: SkusListResponse; + result = await this._list(location, options); + yield result.value || []; + } + + private async *listPagingAll( + location: string, + options?: SkusListOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listPagingPage(location, options)) { + yield* page; + } + } + + /** + * Gets information about skus in specified location for the given subscription id + * @param location The name of Azure region. + * @param options The options parameters. + */ + private _list( + location: string, + options?: SkusListOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { location, options }, + listOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/skus", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.RegionSkuDetails + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.location, + Parameters.subscriptionId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts index 714e0bdd497b..00f71e0fdab6 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/databases.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Database, DatabasesListByClusterOptionalParams, @@ -29,7 +29,9 @@ import { ExportClusterParameters, DatabasesExportOptionalParams, ForceUnlinkParameters, - DatabasesForceUnlinkOptionalParams + DatabasesForceUnlinkOptionalParams, + FlushParameters, + DatabasesFlushOptionalParams } from "../models"; /// @@ -61,8 +63,8 @@ export interface Databases { parameters: Database, options?: DatabasesCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesCreateResponse > >; @@ -96,8 +98,8 @@ export interface Databases { parameters: DatabaseUpdate, options?: DatabasesUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesUpdateResponse > >; @@ -141,7 +143,7 @@ export interface Databases { clusterName: string, databaseName: string, options?: DatabasesDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a single database * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -183,8 +185,8 @@ export interface Databases { parameters: RegenerateKeyParameters, options?: DatabasesRegenerateKeyOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, DatabasesRegenerateKeyResponse > >; @@ -217,7 +219,7 @@ export interface Databases { databaseName: string, parameters: ImportClusterParameters, options?: DatabasesImportOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Imports database files to target database. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -247,7 +249,7 @@ export interface Databases { databaseName: string, parameters: ExportClusterParameters, options?: DatabasesExportOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Exports a database file from target database. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -277,7 +279,7 @@ export interface Databases { databaseName: string, parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Forcibly removes the link to the specified database resource. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -293,4 +295,34 @@ export interface Databases { parameters: ForceUnlinkParameters, options?: DatabasesForceUnlinkOptionalParams ): Promise; + /** + * Flushes all the keys in this database and also from its linked databases. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the databases to be flushed + * @param options The options parameters. + */ + beginFlush( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: FlushParameters, + options?: DatabasesFlushOptionalParams + ): Promise, void>>; + /** + * Flushes all the keys in this database and also from its linked databases. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param databaseName The name of the database. + * @param parameters Information identifying the databases to be flushed + * @param options The options parameters. + */ + beginFlushAndWait( + resourceGroupName: string, + clusterName: string, + databaseName: string, + parameters: FlushParameters, + options?: DatabasesFlushOptionalParams + ): Promise; } diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts index cb8946c7cbcc..408ae886b779 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/index.ts @@ -12,3 +12,4 @@ export * from "./redisEnterprise"; export * from "./databases"; export * from "./privateEndpointConnections"; export * from "./privateLinkResources"; +export * from "./skus"; diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts index a4c3f7de0e22..36d2c2214a4f 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/privateEndpointConnections.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { PrivateEndpointConnection, PrivateEndpointConnectionsListOptionalParams, @@ -63,8 +63,8 @@ export interface PrivateEndpointConnections { properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, PrivateEndpointConnectionsPutResponse > >; @@ -93,7 +93,21 @@ export interface PrivateEndpointConnections { * Azure resource * @param options The options parameters. */ - delete( + beginDelete( + resourceGroupName: string, + clusterName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams + ): Promise, void>>; + /** + * Deletes the specified private endpoint connection associated with the RedisEnterprise cluster. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the RedisEnterprise cluster. + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the + * Azure resource + * @param options The options parameters. + */ + beginDeleteAndWait( resourceGroupName: string, clusterName: string, privateEndpointConnectionName: string, diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts index 0676a7b62dc3..80a3cc7326af 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/redisEnterprise.ts @@ -7,7 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { PollerLike, PollOperationState } from "@azure/core-lro"; +import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { Cluster, RedisEnterpriseListByResourceGroupOptionalParams, @@ -54,8 +54,8 @@ export interface RedisEnterprise { parameters: Cluster, options?: RedisEnterpriseCreateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, RedisEnterpriseCreateResponse > >; @@ -85,8 +85,8 @@ export interface RedisEnterprise { parameters: ClusterUpdate, options?: RedisEnterpriseUpdateOptionalParams ): Promise< - PollerLike< - PollOperationState, + SimplePollerLike< + OperationState, RedisEnterpriseUpdateResponse > >; @@ -113,7 +113,7 @@ export interface RedisEnterprise { resourceGroupName: string, clusterName: string, options?: RedisEnterpriseDeleteOptionalParams - ): Promise, void>>; + ): Promise, void>>; /** * Deletes a RedisEnterprise cache cluster. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/skus.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/skus.ts new file mode 100644 index 000000000000..34c27cc834a1 --- /dev/null +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/operationsInterfaces/skus.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the 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 { RegionSkuDetail, SkusListOptionalParams } from "../models"; + +/// +/** Interface representing a Skus. */ +export interface Skus { + /** + * Gets information about skus in specified location for the given subscription id + * @param location The name of Azure region. + * @param options The options parameters. + */ + list( + location: string, + options?: SkusListOptionalParams + ): PagedAsyncIterableIterator; +} diff --git a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts index 0aacfd43df1a..2ac785f4d5c1 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts +++ b/sdk/redisenterprise/arm-redisenterprisecache/src/redisEnterpriseManagementClient.ts @@ -20,7 +20,8 @@ import { RedisEnterpriseImpl, DatabasesImpl, PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl + PrivateLinkResourcesImpl, + SkusImpl } from "./operations"; import { Operations, @@ -28,7 +29,8 @@ import { RedisEnterprise, Databases, PrivateEndpointConnections, - PrivateLinkResources + PrivateLinkResources, + Skus } from "./operationsInterfaces"; import { RedisEnterpriseManagementClientOptionalParams } from "./models"; @@ -64,7 +66,7 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-redisenterprisecache/2.2.1`; + const packageDetails = `azsdk-js-arm-redisenterprisecache/3.0.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -117,13 +119,14 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2022-01-01"; + this.apiVersion = options.apiVersion || "2023-03-01-preview"; this.operations = new OperationsImpl(this); this.operationsStatus = new OperationsStatusImpl(this); this.redisEnterprise = new RedisEnterpriseImpl(this); this.databases = new DatabasesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.skus = new SkusImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -161,4 +164,5 @@ export class RedisEnterpriseManagementClient extends coreClient.ServiceClient { databases: Databases; privateEndpointConnections: PrivateEndpointConnections; privateLinkResources: PrivateLinkResources; + skus: Skus; } diff --git a/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json b/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json index b929ba4f3f0f..3e6ae96443f3 100644 --- a/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json +++ b/sdk/redisenterprise/arm-redisenterprisecache/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-redisenterprisecache": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"