From 575713c6218550b966df5a844db865513ef37820 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 15 Jul 2022 00:28:10 +0000 Subject: [PATCH] CodeGen from PR 19721 in Azure/azure-rest-api-specs Merge d142ff69b9612d9581ecaa654b1d42b5ca133292 into e59b6449e6613c0e4ecb73daacacdff320d65f67 --- sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md | 78 ++- sdk/cosmosdb/arm-cosmosdb/_meta.json | 10 +- sdk/cosmosdb/arm-cosmosdb/package.json | 12 +- .../arm-cosmosdb/review/arm-cosmosdb.api.md | 274 +++++++- .../src/cosmosDBManagementClient.ts | 38 +- sdk/cosmosdb/arm-cosmosdb/src/models/index.ts | 396 ++++++++++- .../arm-cosmosdb/src/models/mappers.ts | 635 +++++++++++++++++- .../arm-cosmosdb/src/models/parameters.ts | 20 +- .../src/operations/dataTransferJobs.ts | 134 +++- .../src/operations/mongoDBResources.ts | 456 +++++++++++++ .../operations/restorableGremlinResources.ts | 8 +- .../operations/restorableMongodbResources.ts | 8 +- .../src/operations/restorableSqlResources.ts | 8 +- .../operations/restorableTableResources.ts | 7 +- .../src/operations/sqlResources.ts | 452 +++++++++++++ .../operationsInterfaces/dataTransferJobs.ts | 47 +- .../operationsInterfaces/mongoDBResources.ts | 138 ++++ .../restorableGremlinResources.ts | 4 +- .../restorableMongodbResources.ts | 4 +- .../restorableSqlResources.ts | 4 +- .../restorableTableResources.ts | 7 +- .../src/operationsInterfaces/sqlResources.ts | 134 ++++ sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts | 43 ++ 23 files changed, 2837 insertions(+), 80 deletions(-) create mode 100644 sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts diff --git a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md index 087dd70c32e6..78acc33231ed 100644 --- a/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md +++ b/sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md @@ -1,16 +1,6 @@ # Release History - -## 16.0.0-beta.3 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 16.0.0-beta.2 (2022-04-15) + +## 15.1.0-beta.1 (2022-07-15) **Features** @@ -47,16 +37,29 @@ - Added operation MongoDBResources.beginDeleteMongoRoleDefinitionAndWait - Added operation MongoDBResources.beginDeleteMongoUserDefinition - Added operation MongoDBResources.beginDeleteMongoUserDefinitionAndWait + - Added operation MongoDBResources.beginListMongoDBCollectionPartitionMerge + - Added operation MongoDBResources.beginListMongoDBCollectionPartitionMergeAndWait + - Added operation MongoDBResources.beginMongoDBContainerRedistributeThroughput + - Added operation MongoDBResources.beginMongoDBContainerRedistributeThroughputAndWait + - Added operation MongoDBResources.beginMongoDBContainerRetrieveThroughputDistribution + - Added operation MongoDBResources.beginMongoDBContainerRetrieveThroughputDistributionAndWait - Added operation MongoDBResources.getMongoRoleDefinition - Added operation MongoDBResources.getMongoUserDefinition - Added operation MongoDBResources.listMongoRoleDefinitions - Added operation MongoDBResources.listMongoUserDefinitions - Added operation SqlResources.beginCreateUpdateClientEncryptionKey - Added operation SqlResources.beginCreateUpdateClientEncryptionKeyAndWait + - Added operation SqlResources.beginListSqlContainerPartitionMerge + - Added operation SqlResources.beginListSqlContainerPartitionMergeAndWait + - Added operation SqlResources.beginSqlContainerRedistributeThroughput + - Added operation SqlResources.beginSqlContainerRedistributeThroughputAndWait + - Added operation SqlResources.beginSqlContainerRetrieveThroughputDistribution + - Added operation SqlResources.beginSqlContainerRetrieveThroughputDistributionAndWait - Added operation SqlResources.getClientEncryptionKey - Added operation SqlResources.listClientEncryptionKeys - Added operation TableResources.beginRetrieveContinuousBackupInformation - Added operation TableResources.beginRetrieveContinuousBackupInformationAndWait + - Added Interface AccountKeyMetadata - Added Interface AuthenticationMethodLdapProperties - Added Interface BackupResourceProperties - Added Interface CassandraClustersGetBackupOptionalParams @@ -71,16 +74,23 @@ - Added Interface CassandraResourcesUpdateCassandraViewThroughputOptionalParams - Added Interface CassandraViewListResult - Added Interface CassandraViewResource + - Added Interface ClientEncryptionIncludedPath - Added Interface ClientEncryptionKeyCreateUpdateParameters - Added Interface ClientEncryptionKeyResource - Added Interface ClientEncryptionKeysListResult + - Added Interface ClientEncryptionPolicy + - Added Interface ContinuousModeProperties + - Added Interface DatabaseAccountKeysMetadata - Added Interface DataTransferDataSourceSink - Added Interface DataTransferJobFeedResults - Added Interface DataTransferJobProperties + - Added Interface DataTransferJobsCancelOptionalParams - Added Interface DataTransferJobsCreateOptionalParams - Added Interface DataTransferJobsGetOptionalParams - Added Interface DataTransferJobsListByDatabaseAccountNextOptionalParams - Added Interface DataTransferJobsListByDatabaseAccountOptionalParams + - Added Interface DataTransferJobsPauseOptionalParams + - Added Interface DataTransferJobsResumeOptionalParams - Added Interface DataTransferServiceResource - Added Interface DiagnosticLogSettings - Added Interface GraphAPIComputeServiceResource @@ -95,20 +105,30 @@ - Added Interface KeyWrapMetadata - Added Interface ListBackups - Added Interface MaterializedViewsBuilderServiceResource + - Added Interface MergeParameters - Added Interface MongoDBResourcesCreateUpdateMongoRoleDefinitionOptionalParams - Added Interface MongoDBResourcesCreateUpdateMongoUserDefinitionOptionalParams - Added Interface MongoDBResourcesDeleteMongoRoleDefinitionOptionalParams - Added Interface MongoDBResourcesDeleteMongoUserDefinitionOptionalParams - Added Interface MongoDBResourcesGetMongoRoleDefinitionOptionalParams - Added Interface MongoDBResourcesGetMongoUserDefinitionOptionalParams + - Added Interface MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams - Added Interface MongoDBResourcesListMongoRoleDefinitionsOptionalParams - Added Interface MongoDBResourcesListMongoUserDefinitionsOptionalParams + - Added Interface MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + - Added Interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams - Added Interface MongoRoleDefinitionCreateUpdateParameters - Added Interface MongoRoleDefinitionListResult - Added Interface MongoUserDefinitionCreateUpdateParameters - Added Interface MongoUserDefinitionListResult + - Added Interface PhysicalPartitionId + - Added Interface PhysicalPartitionStorageInfo + - Added Interface PhysicalPartitionStorageInfoCollection + - Added Interface PhysicalPartitionThroughputInfoProperties + - Added Interface PhysicalPartitionThroughputInfoResource - Added Interface Privilege - Added Interface PrivilegeResource + - Added Interface RedistributeThroughputPropertiesResource - Added Interface RegionalServiceResource - Added Interface RestorableGremlinDatabaseGetResult - Added Interface RestorableGremlinDatabasePropertiesResource @@ -118,14 +138,19 @@ - Added Interface RestorableGremlinGraphPropertiesResource - Added Interface RestorableGremlinGraphsListOptionalParams - Added Interface RestorableGremlinGraphsListResult + - Added Interface RestorableGremlinResourcesGetResult - Added Interface RestorableGremlinResourcesListOptionalParams - Added Interface RestorableGremlinResourcesListResult + - Added Interface RestorableMongodbResourcesGetResult + - Added Interface RestorableSqlResourcesGetResult - Added Interface RestorableTableGetResult - Added Interface RestorableTablePropertiesResource + - Added Interface RestorableTableResourcesGetResult - Added Interface RestorableTableResourcesListOptionalParams - Added Interface RestorableTableResourcesListResult - Added Interface RestorableTablesListOptionalParams - Added Interface RestorableTablesListResult + - Added Interface RetrieveThroughputPropertiesResource - Added Interface Role - Added Interface ServiceCreateOptionalParams - Added Interface ServiceDeleteOptionalParams @@ -138,6 +163,9 @@ - Added Interface SqlResourcesCreateUpdateClientEncryptionKeyOptionalParams - Added Interface SqlResourcesGetClientEncryptionKeyOptionalParams - Added Interface SqlResourcesListClientEncryptionKeysOptionalParams + - Added Interface SqlResourcesListSqlContainerPartitionMergeOptionalParams + - Added Interface SqlResourcesSqlContainerRedistributeThroughputOptionalParams + - Added Interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams - Added Interface TableResourcesRetrieveContinuousBackupInformationOptionalParams - Added Type Alias AzureBlobDataTransferDataSourceSink - Added Type Alias BackupResource @@ -156,16 +184,20 @@ - Added Type Alias CassandraViewGetResults - Added Type Alias ClientEncryptionKeyGetPropertiesResource - Added Type Alias ClientEncryptionKeyGetResults + - Added Type Alias ContinuousTier - Added Type Alias CosmosCassandraDataTransferDataSourceSink - Added Type Alias CosmosSqlDataTransferDataSourceSink - Added Type Alias CreateJobRequest - Added Type Alias DataTransferComponent - Added Type Alias DataTransferDataSourceSinkUnion - Added Type Alias DataTransferJobGetResults + - Added Type Alias DataTransferJobsCancelResponse - Added Type Alias DataTransferJobsCreateResponse - Added Type Alias DataTransferJobsGetResponse - Added Type Alias DataTransferJobsListByDatabaseAccountNextResponse - Added Type Alias DataTransferJobsListByDatabaseAccountResponse + - Added Type Alias DataTransferJobsPauseResponse + - Added Type Alias DataTransferJobsResumeResponse - Added Type Alias DataTransferRegionalServiceResource - Added Type Alias DataTransferServiceResourceProperties - Added Type Alias EnableFullTextQuery @@ -185,16 +217,23 @@ - Added Type Alias MongoDBResourcesCreateUpdateMongoUserDefinitionResponse - Added Type Alias MongoDBResourcesGetMongoRoleDefinitionResponse - Added Type Alias MongoDBResourcesGetMongoUserDefinitionResponse + - Added Type Alias MongoDBResourcesListMongoDBCollectionPartitionMergeResponse - Added Type Alias MongoDBResourcesListMongoRoleDefinitionsResponse - Added Type Alias MongoDBResourcesListMongoUserDefinitionsResponse + - Added Type Alias MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + - Added Type Alias MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse - Added Type Alias MongoRoleDefinitionGetResults - Added Type Alias MongoRoleDefinitionType - Added Type Alias MongoUserDefinitionGetResults + - Added Type Alias PhysicalPartitionThroughputInfoResult + - Added Type Alias PhysicalPartitionThroughputInfoResultPropertiesResource + - Added Type Alias RedistributeThroughputParameters - Added Type Alias RestorableGremlinDatabasesListResponse - Added Type Alias RestorableGremlinGraphsListResponse - Added Type Alias RestorableGremlinResourcesListResponse - Added Type Alias RestorableTableResourcesListResponse - Added Type Alias RestorableTablesListResponse + - Added Type Alias RetrieveThroughputParameters - Added Type Alias ServiceCreateResponse - Added Type Alias ServiceGetResponse - Added Type Alias ServiceListResponse @@ -208,16 +247,24 @@ - Added Type Alias SqlResourcesCreateUpdateClientEncryptionKeyResponse - Added Type Alias SqlResourcesGetClientEncryptionKeyResponse - Added Type Alias SqlResourcesListClientEncryptionKeysResponse + - Added Type Alias SqlResourcesListSqlContainerPartitionMergeResponse + - Added Type Alias SqlResourcesSqlContainerRedistributeThroughputResponse + - Added Type Alias SqlResourcesSqlContainerRetrieveThroughputDistributionResponse - Added Type Alias TableResourcesRetrieveContinuousBackupInformationResponse + - Added Type Alias ThroughputPolicyType - Interface ARMResourceProperties has a new optional parameter identity - Interface DatabaseAccountUpdateParameters has a new optional parameter diagnosticLogSettings - Interface DatabaseAccountUpdateParameters has a new optional parameter enableMaterializedViews + - Interface DatabaseAccountUpdateParameters has a new optional parameter keysMetadata - Interface DataCenterResourceProperties has a new optional parameter authenticationMethodLdapProperties + - Interface GremlinGraphResource has a new optional parameter analyticalStorageTtl - Interface LocationProperties has a new optional parameter status + - Interface RestorableDatabaseAccountGetResult has a new optional parameter oldestRestorableTime - Interface RestorableMongodbCollectionsListOptionalParams has a new optional parameter endTime - Interface RestorableMongodbCollectionsListOptionalParams has a new optional parameter startTime - Interface RestoreParameters has a new optional parameter gremlinDatabasesToRestore - Interface RestoreParameters has a new optional parameter tablesToRestore + - Interface SqlContainerResource has a new optional parameter clientEncryptionPolicy - Class CosmosDBManagementClient has a new parameter dataTransferJobs - Class CosmosDBManagementClient has a new parameter graphResources - Class CosmosDBManagementClient has a new parameter restorableGremlinDatabases @@ -226,16 +273,21 @@ - Class CosmosDBManagementClient has a new parameter restorableTableResources - Class CosmosDBManagementClient has a new parameter restorableTables - Class CosmosDBManagementClient has a new parameter service + - Type Alias ContinuousModeBackupPolicy has a new parameter continuousModeProperties - Type Alias DatabaseAccountCreateUpdateParameters has a new parameter diagnosticLogSettings - Type Alias DatabaseAccountCreateUpdateParameters has a new parameter enableMaterializedViews + - Type Alias DatabaseAccountCreateUpdateParameters has a new parameter keysMetadata - Type Alias DatabaseAccountGetResults has a new parameter diagnosticLogSettings - Type Alias DatabaseAccountGetResults has a new parameter enableMaterializedViews + - Type Alias DatabaseAccountGetResults has a new parameter keysMetadata + - Added Enum KnownContinuousTier - Added Enum KnownDataTransferComponent - Added Enum KnownServiceSize - Added Enum KnownServiceStatus - Added Enum KnownServiceType + - Added Enum KnownThroughputPolicyType - Enum KnownAuthenticationMethod has a new value Ldap - - Bug fix + - Enum KnownServerVersion has a new value Four2 ## 15.0.0 (2021-12-09) diff --git a/sdk/cosmosdb/arm-cosmosdb/_meta.json b/sdk/cosmosdb/arm-cosmosdb/_meta.json index 71b309bffda3..f4b7ae36507c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/_meta.json +++ b/sdk/cosmosdb/arm-cosmosdb/_meta.json @@ -1,8 +1,8 @@ { - "commit": "bb9f1204f9a337404ff7e7b73b4c7b4ddde7f8f1", - "readme": "specification\\cosmos-db\\resource-manager\\readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\cosmos-db\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1", + "commit": "e954f0a5de636f87e2b19de100b53ffd8b7a353f", + "readme": "specification/cosmos-db/resource-manager/readme.md", + "autorest_command": "autorest --version=3.7.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/cosmos-db/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.4.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/cosmosdb/arm-cosmosdb/package.json b/sdk/cosmosdb/arm-cosmosdb/package.json index fb213d55ec29..0121583f9e3c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/package.json +++ b/sdk/cosmosdb/arm-cosmosdb/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for CosmosDBManagementClient.", - "version": "16.0.0-beta.3", + "version": "15.1.0-beta.1", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/cosmosdb/arm-cosmosdb", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -107,4 +109,4 @@ ] }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md index 0857e2bb1d5e..566877a3520d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md +++ b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md @@ -10,6 +10,11 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export interface AccountKeyMetadata { + readonly generationTime?: Date; +} + // @public export interface AnalyticalStorageConfiguration { schemaType?: AnalyticalStorageSchemaType; @@ -648,6 +653,14 @@ export interface Certificate { pem?: string; } +// @public (undocumented) +export interface ClientEncryptionIncludedPath { + clientEncryptionKeyId: string; + encryptionAlgorithm: string; + encryptionType: string; + path: string; +} + // @public export interface ClientEncryptionKeyCreateUpdateParameters { resource: ClientEncryptionKeyResource; @@ -674,6 +687,12 @@ export interface ClientEncryptionKeysListResult { readonly value?: ClientEncryptionKeyGetResults[]; } +// @public +export interface ClientEncryptionPolicy { + includedPaths: ClientEncryptionIncludedPath[]; + policyFormatVersion?: number; +} + // @public export interface CloudError { error?: ErrorResponse; @@ -897,8 +916,17 @@ export interface ContinuousBackupRestoreLocation { // @public export type ContinuousModeBackupPolicy = BackupPolicy & { type: "Continuous"; + continuousModeProperties?: ContinuousModeProperties; }; +// @public +export interface ContinuousModeProperties { + tier?: ContinuousTier; +} + +// @public +export type ContinuousTier = string; + // @public export interface CorsPolicy { allowedHeaders?: string; @@ -1080,6 +1108,7 @@ export type DatabaseAccountCreateUpdateParameters = ARMResourceProperties & { restoreParameters?: RestoreParameters; capacity?: Capacity; enableMaterializedViews?: boolean; + keysMetadata?: DatabaseAccountKeysMetadata; }; // @public @@ -1122,8 +1151,17 @@ export type DatabaseAccountGetResults = ARMResourceProperties & { disableLocalAuth?: boolean; capacity?: Capacity; enableMaterializedViews?: boolean; + keysMetadata?: DatabaseAccountKeysMetadata; }; +// @public +export interface DatabaseAccountKeysMetadata { + primaryMasterKey?: AccountKeyMetadata; + primaryReadonlyMasterKey?: AccountKeyMetadata; + secondaryMasterKey?: AccountKeyMetadata; + secondaryReadonlyMasterKey?: AccountKeyMetadata; +} + // @public export type DatabaseAccountKind = string; @@ -1346,6 +1384,7 @@ export interface DatabaseAccountUpdateParameters { identity?: ManagedServiceIdentity; ipRules?: IpAddressOrRange[]; isVirtualNetworkFilterEnabled?: boolean; + keysMetadata?: DatabaseAccountKeysMetadata; keyVaultKeyUri?: string; location?: string; locations?: Location_2[]; @@ -1431,7 +1470,8 @@ export type DataTransferJobGetResults = ARMProxyResource & { source?: DataTransferDataSourceSinkUnion; destination?: DataTransferDataSourceSinkUnion; readonly status?: string; - readonly percentageComplete?: number; + readonly processedCount?: number; + readonly totalCount?: number; readonly lastUpdatedUtcTime?: Date; workerCount?: number; readonly error?: ErrorResponse; @@ -1443,19 +1483,30 @@ export interface DataTransferJobProperties { readonly error?: ErrorResponse; readonly jobName?: string; readonly lastUpdatedUtcTime?: Date; - readonly percentageComplete?: number; + readonly processedCount?: number; source: DataTransferDataSourceSinkUnion; readonly status?: string; + readonly totalCount?: number; workerCount?: number; } // @public export interface DataTransferJobs { + cancel(resourceGroupName: string, accountName: string, jobName: string, options?: DataTransferJobsCancelOptionalParams): Promise; create(resourceGroupName: string, accountName: string, jobName: string, jobCreateParameters: CreateJobRequest, options?: DataTransferJobsCreateOptionalParams): Promise; get(resourceGroupName: string, accountName: string, jobName: string, options?: DataTransferJobsGetOptionalParams): Promise; listByDatabaseAccount(resourceGroupName: string, accountName: string, options?: DataTransferJobsListByDatabaseAccountOptionalParams): PagedAsyncIterableIterator; + pause(resourceGroupName: string, accountName: string, jobName: string, options?: DataTransferJobsPauseOptionalParams): Promise; + resume(resourceGroupName: string, accountName: string, jobName: string, options?: DataTransferJobsResumeOptionalParams): Promise; +} + +// @public +export interface DataTransferJobsCancelOptionalParams extends coreClient.OperationOptions { } +// @public +export type DataTransferJobsCancelResponse = DataTransferJobGetResults; + // @public export interface DataTransferJobsCreateOptionalParams extends coreClient.OperationOptions { } @@ -1484,6 +1535,20 @@ export interface DataTransferJobsListByDatabaseAccountOptionalParams extends cor // @public export type DataTransferJobsListByDatabaseAccountResponse = DataTransferJobFeedResults; +// @public +export interface DataTransferJobsPauseOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsPauseResponse = DataTransferJobGetResults; + +// @public +export interface DataTransferJobsResumeOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type DataTransferJobsResumeResponse = DataTransferJobGetResults; + // @public export type DataTransferRegionalServiceResource = RegionalServiceResource & {}; @@ -1685,6 +1750,7 @@ export interface GremlinGraphListResult { // @public export interface GremlinGraphResource { + analyticalStorageTtl?: number; conflictResolutionPolicy?: ConflictResolutionPolicy; defaultTtl?: number; id: string; @@ -1899,6 +1965,7 @@ export type KeyKind = string; // @public export interface KeyWrapMetadata { + algorithm?: string; name?: string; type?: string; value?: string; @@ -2006,6 +2073,14 @@ export enum KnownConnectorOffer { Small = "Small" } +// @public +export enum KnownContinuousTier { + // (undocumented) + Continuous30Days = "Continuous30Days", + // (undocumented) + Continuous7Days = "Continuous7Days" +} + // @public export enum KnownCreatedByType { // (undocumented) @@ -2203,6 +2278,8 @@ export enum KnownServerVersion { // (undocumented) Four0 = "4.0", // (undocumented) + Four2 = "4.2", + // (undocumented) Three2 = "3.2", // (undocumented) Three6 = "3.6" @@ -2258,6 +2335,16 @@ export enum KnownSpatialType { Polygon = "Polygon" } +// @public +export enum KnownThroughputPolicyType { + // (undocumented) + Custom = "custom", + // (undocumented) + Equal = "equal", + // (undocumented) + None = "none" +} + // @public export enum KnownTriggerOperation { // (undocumented) @@ -2423,6 +2510,11 @@ export type MaterializedViewsBuilderServiceResourceProperties = ServiceResourceP readonly locations?: MaterializedViewsBuilderRegionalServiceResource[]; }; +// @public +export interface MergeParameters { + isDryRun?: boolean; +} + // @public export interface Metric { readonly endTime?: Date; @@ -2553,6 +2645,8 @@ export interface MongoDBResources { beginDeleteMongoRoleDefinitionAndWait(mongoRoleDefinitionId: string, resourceGroupName: string, accountName: string, options?: MongoDBResourcesDeleteMongoRoleDefinitionOptionalParams): Promise; beginDeleteMongoUserDefinition(mongoUserDefinitionId: string, resourceGroupName: string, accountName: string, options?: MongoDBResourcesDeleteMongoUserDefinitionOptionalParams): Promise, void>>; beginDeleteMongoUserDefinitionAndWait(mongoUserDefinitionId: string, resourceGroupName: string, accountName: string, options?: MongoDBResourcesDeleteMongoUserDefinitionOptionalParams): Promise; + beginListMongoDBCollectionPartitionMerge(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, mergeParameters: MergeParameters, options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams): Promise, MongoDBResourcesListMongoDBCollectionPartitionMergeResponse>>; + beginListMongoDBCollectionPartitionMergeAndWait(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, mergeParameters: MergeParameters, options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams): Promise; beginMigrateMongoDBCollectionToAutoscale(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: MongoDBResourcesMigrateMongoDBCollectionToAutoscaleOptionalParams): Promise, MongoDBResourcesMigrateMongoDBCollectionToAutoscaleResponse>>; beginMigrateMongoDBCollectionToAutoscaleAndWait(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: MongoDBResourcesMigrateMongoDBCollectionToAutoscaleOptionalParams): Promise; beginMigrateMongoDBCollectionToManualThroughput(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, options?: MongoDBResourcesMigrateMongoDBCollectionToManualThroughputOptionalParams): Promise, MongoDBResourcesMigrateMongoDBCollectionToManualThroughputResponse>>; @@ -2561,6 +2655,10 @@ export interface MongoDBResources { beginMigrateMongoDBDatabaseToAutoscaleAndWait(resourceGroupName: string, accountName: string, databaseName: string, options?: MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleOptionalParams): Promise; beginMigrateMongoDBDatabaseToManualThroughput(resourceGroupName: string, accountName: string, databaseName: string, options?: MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams): Promise, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse>>; beginMigrateMongoDBDatabaseToManualThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, options?: MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams): Promise; + beginMongoDBContainerRedistributeThroughput(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams): Promise, MongoDBResourcesMongoDBContainerRedistributeThroughputResponse>>; + beginMongoDBContainerRedistributeThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams): Promise; + beginMongoDBContainerRetrieveThroughputDistribution(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams): Promise, MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse>>; + beginMongoDBContainerRetrieveThroughputDistributionAndWait(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams): Promise; beginRetrieveContinuousBackupInformation(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, location: ContinuousBackupRestoreLocation, options?: MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams): Promise, MongoDBResourcesRetrieveContinuousBackupInformationResponse>>; beginRetrieveContinuousBackupInformationAndWait(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, location: ContinuousBackupRestoreLocation, options?: MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams): Promise; beginUpdateMongoDBCollectionThroughput(resourceGroupName: string, accountName: string, databaseName: string, collectionName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams): Promise, MongoDBResourcesUpdateMongoDBCollectionThroughputResponse>>; @@ -2681,6 +2779,15 @@ export interface MongoDBResourcesGetMongoUserDefinitionOptionalParams extends co // @public export type MongoDBResourcesGetMongoUserDefinitionResponse = MongoUserDefinitionGetResults; +// @public +export interface MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesListMongoDBCollectionPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + // @public export interface MongoDBResourcesListMongoDBCollectionsOptionalParams extends coreClient.OperationOptions { } @@ -2745,6 +2852,24 @@ export interface MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptiona // @public export type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse = ThroughputSettingsGetResults; +// @public +export interface MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesMongoDBContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + // @public export interface MongoDBResourcesRetrieveContinuousBackupInformationOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -3113,6 +3238,41 @@ export interface Permission { notDataActions?: string[]; } +// @public +export interface PhysicalPartitionId { + id: string; +} + +// @public +export interface PhysicalPartitionStorageInfo { + readonly id?: string; + readonly storageInKB?: number; +} + +// @public +export interface PhysicalPartitionStorageInfoCollection { + readonly physicalPartitionStorageInfoCollection?: PhysicalPartitionStorageInfo[]; +} + +// @public +export interface PhysicalPartitionThroughputInfoProperties { + physicalPartitionThroughputInfo?: PhysicalPartitionThroughputInfoResource[]; +} + +// @public +export interface PhysicalPartitionThroughputInfoResource { + id: string; + throughput?: number; +} + +// @public +export type PhysicalPartitionThroughputInfoResult = ARMResourceProperties & { + resource?: PhysicalPartitionThroughputInfoResultPropertiesResource; +}; + +// @public +export type PhysicalPartitionThroughputInfoResultPropertiesResource = PhysicalPartitionThroughputInfoProperties & {}; + // @public export type PrimaryAggregationType = string; @@ -3230,6 +3390,18 @@ export type ProxyResource = Resource & {}; // @public export type PublicNetworkAccess = string; +// @public +export type RedistributeThroughputParameters = ARMResourceProperties & { + resource: RedistributeThroughputPropertiesResource; +}; + +// @public +export interface RedistributeThroughputPropertiesResource { + sourcePhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; + targetPhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; + throughputPolicy: ThroughputPolicyType; +} + // @public export interface RegionalServiceResource { readonly location?: string; @@ -3261,6 +3433,7 @@ export interface RestorableDatabaseAccountGetResult { readonly id?: string; location?: string; readonly name?: string; + oldestRestorableTime?: Date; readonly restorableLocations?: RestorableLocationResource[]; readonly type?: string; } @@ -3371,7 +3544,16 @@ export interface RestorableGremlinGraphsListResult { // @public export interface RestorableGremlinResources { - list(location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams): PagedAsyncIterableIterator; + list(location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RestorableGremlinResourcesGetResult { + databaseName?: string; + graphNames?: string[]; + readonly id?: string; + readonly name?: string; + readonly type?: string; } // @public @@ -3385,7 +3567,7 @@ export type RestorableGremlinResourcesListResponse = RestorableGremlinResourcesL // @public export interface RestorableGremlinResourcesListResult { - readonly value?: GremlinDatabaseRestoreResource[]; + readonly value?: RestorableGremlinResourcesGetResult[]; } // @public @@ -3469,7 +3651,16 @@ export interface RestorableMongodbDatabasesListResult { // @public export interface RestorableMongodbResources { - list(location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams): PagedAsyncIterableIterator; + list(location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RestorableMongodbResourcesGetResult { + collectionNames?: string[]; + databaseName?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; } // @public @@ -3483,7 +3674,7 @@ export type RestorableMongodbResourcesListResponse = RestorableMongodbResourcesL // @public export interface RestorableMongodbResourcesListResult { - readonly value?: DatabaseRestoreResource[]; + readonly value?: RestorableMongodbResourcesGetResult[]; } // @public @@ -3573,7 +3764,16 @@ export interface RestorableSqlDatabasesListResult { // @public export interface RestorableSqlResources { - list(location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams): PagedAsyncIterableIterator; + list(location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RestorableSqlResourcesGetResult { + collectionNames?: string[]; + databaseName?: string; + readonly id?: string; + readonly name?: string; + readonly type?: string; } // @public @@ -3587,7 +3787,7 @@ export type RestorableSqlResourcesListResponse = RestorableSqlResourcesListResul // @public export interface RestorableSqlResourcesListResult { - readonly value?: DatabaseRestoreResource[]; + readonly value?: RestorableSqlResourcesGetResult[]; } // @public @@ -3609,7 +3809,14 @@ export interface RestorableTablePropertiesResource { // @public export interface RestorableTableResources { - list(location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams): PagedAsyncIterableIterator; + list(location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface RestorableTableResourcesGetResult { + readonly id?: string; + readonly name?: string; + readonly type?: string; } // @public @@ -3623,7 +3830,7 @@ export type RestorableTableResourcesListResponse = RestorableTableResourcesListR // @public export interface RestorableTableResourcesListResult { - readonly value?: string[]; + readonly value?: RestorableTableResourcesGetResult[]; } // @public @@ -3658,6 +3865,16 @@ export interface RestoreParameters { tablesToRestore?: string[]; } +// @public +export type RetrieveThroughputParameters = ARMResourceProperties & { + resource: RetrieveThroughputPropertiesResource; +}; + +// @public +export interface RetrieveThroughputPropertiesResource { + physicalPartitionIds: PhysicalPartitionId[]; +} + // @public export interface Role { db?: string; @@ -3788,6 +4005,7 @@ export interface SqlContainerListResult { // @public export interface SqlContainerResource { analyticalStorageTtl?: number; + clientEncryptionPolicy?: ClientEncryptionPolicy; conflictResolutionPolicy?: ConflictResolutionPolicy; defaultTtl?: number; id: string; @@ -3876,6 +4094,8 @@ export interface SqlResources { beginDeleteSqlTriggerAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, triggerName: string, options?: SqlResourcesDeleteSqlTriggerOptionalParams): Promise; beginDeleteSqlUserDefinedFunction(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, userDefinedFunctionName: string, options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams): Promise, void>>; beginDeleteSqlUserDefinedFunctionAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, userDefinedFunctionName: string, options?: SqlResourcesDeleteSqlUserDefinedFunctionOptionalParams): Promise; + beginListSqlContainerPartitionMerge(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, mergeParameters: MergeParameters, options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams): Promise, SqlResourcesListSqlContainerPartitionMergeResponse>>; + beginListSqlContainerPartitionMergeAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, mergeParameters: MergeParameters, options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams): Promise; beginMigrateSqlContainerToAutoscale(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: SqlResourcesMigrateSqlContainerToAutoscaleOptionalParams): Promise, SqlResourcesMigrateSqlContainerToAutoscaleResponse>>; beginMigrateSqlContainerToAutoscaleAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: SqlResourcesMigrateSqlContainerToAutoscaleOptionalParams): Promise; beginMigrateSqlContainerToManualThroughput(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, options?: SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams): Promise, SqlResourcesMigrateSqlContainerToManualThroughputResponse>>; @@ -3886,6 +4106,10 @@ export interface SqlResources { beginMigrateSqlDatabaseToManualThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, options?: SqlResourcesMigrateSqlDatabaseToManualThroughputOptionalParams): Promise; beginRetrieveContinuousBackupInformation(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, location: ContinuousBackupRestoreLocation, options?: SqlResourcesRetrieveContinuousBackupInformationOptionalParams): Promise, SqlResourcesRetrieveContinuousBackupInformationResponse>>; beginRetrieveContinuousBackupInformationAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, location: ContinuousBackupRestoreLocation, options?: SqlResourcesRetrieveContinuousBackupInformationOptionalParams): Promise; + beginSqlContainerRedistributeThroughput(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams): Promise, SqlResourcesSqlContainerRedistributeThroughputResponse>>; + beginSqlContainerRedistributeThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, redistributeThroughputParameters: RedistributeThroughputParameters, options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams): Promise; + beginSqlContainerRetrieveThroughputDistribution(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams): Promise, SqlResourcesSqlContainerRetrieveThroughputDistributionResponse>>; + beginSqlContainerRetrieveThroughputDistributionAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, retrieveThroughputParameters: RetrieveThroughputParameters, options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams): Promise; beginUpdateSqlContainerThroughput(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: SqlResourcesUpdateSqlContainerThroughputOptionalParams): Promise, SqlResourcesUpdateSqlContainerThroughputResponse>>; beginUpdateSqlContainerThroughputAndWait(resourceGroupName: string, accountName: string, databaseName: string, containerName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: SqlResourcesUpdateSqlContainerThroughputOptionalParams): Promise; beginUpdateSqlDatabaseThroughput(resourceGroupName: string, accountName: string, databaseName: string, updateThroughputParameters: ThroughputSettingsUpdateParameters, options?: SqlResourcesUpdateSqlDatabaseThroughputOptionalParams): Promise, SqlResourcesUpdateSqlDatabaseThroughputResponse>>; @@ -4101,6 +4325,15 @@ export interface SqlResourcesListClientEncryptionKeysOptionalParams extends core // @public export type SqlResourcesListClientEncryptionKeysResponse = ClientEncryptionKeysListResult; +// @public +export interface SqlResourcesListSqlContainerPartitionMergeOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesListSqlContainerPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + // @public export interface SqlResourcesListSqlContainersOptionalParams extends coreClient.OperationOptions { } @@ -4195,6 +4428,24 @@ export interface SqlResourcesRetrieveContinuousBackupInformationOptionalParams e // @public export type SqlResourcesRetrieveContinuousBackupInformationResponse = BackupInformation; +// @public +export interface SqlResourcesSqlContainerRedistributeThroughputOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + +// @public +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; +} + +// @public +export type SqlResourcesSqlContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + // @public export interface SqlResourcesUpdateSqlContainerThroughputOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -4465,6 +4716,9 @@ export interface ThroughputPolicyResource { isEnabled?: boolean; } +// @public +export type ThroughputPolicyType = string; + // @public (undocumented) export type ThroughputSettingsGetPropertiesResource = ThroughputSettingsResource & ExtendedResourceProperties & {}; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts index fcbffb25cf2a..35a6b49e83f4 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/cosmosDBManagementClient.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { DatabaseAccountsImpl, @@ -125,7 +130,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-cosmosdb/16.0.0-beta.3`; + const packageDetails = `azsdk-js-arm-cosmosdb/15.1.0-beta.1`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -172,7 +177,7 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-11-15-preview"; + this.apiVersion = options.apiVersion || "2022-05-15-preview"; this.databaseAccounts = new DatabaseAccountsImpl(this); this.operations = new OperationsImpl(this); this.database = new DatabaseImpl(this); @@ -214,6 +219,35 @@ export class CosmosDBManagementClient extends coreClient.ServiceClient { this.restorableTables = new RestorableTablesImpl(this); this.restorableTableResources = new RestorableTableResourcesImpl(this); this.service = new ServiceImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } databaseAccounts: DatabaseAccounts; diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts index bf19273468a1..c7151ee5e887 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -217,6 +217,27 @@ export interface Capacity { totalThroughputLimit?: number; } +/** The metadata related to each access key for the given Cosmos DB database account. */ +export interface DatabaseAccountKeysMetadata { + /** The metadata related to the Primary Read-Write Key for the given Cosmos DB database account. */ + primaryMasterKey?: AccountKeyMetadata; + /** The metadata related to the Secondary Read-Write Key for the given Cosmos DB database account. */ + secondaryMasterKey?: AccountKeyMetadata; + /** The metadata related to the Primary Read-Only Key for the given Cosmos DB database account. */ + primaryReadonlyMasterKey?: AccountKeyMetadata; + /** The metadata related to the Secondary Read-Only Key for the given Cosmos DB database account. */ + secondaryReadonlyMasterKey?: AccountKeyMetadata; +} + +/** The metadata related to an access key for a given database account. */ +export interface AccountKeyMetadata { + /** + * Generation time in UTC of the key in ISO-8601 format. If the value is missing from the object, it means that the last key regeneration was triggered before 2022-06-18. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly generationTime?: Date; +} + /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ @@ -351,6 +372,8 @@ export interface DatabaseAccountUpdateParameters { capacity?: Capacity; /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; + /** This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ + keysMetadata?: DatabaseAccountKeysMetadata; } /** The list of new failover policies for the failover priority change. */ @@ -842,6 +865,8 @@ export interface KeyWrapMetadata { type?: string; /** Reference / link to the KeyEncryptionKey. */ value?: string; + /** Algorithm used in wrapping and unwrapping of the data encryption key. */ + algorithm?: string; } /** The resource model definition for a ARM proxy resource. It will have everything other than required location and tags */ @@ -892,6 +917,8 @@ export interface SqlContainerResource { uniqueKeyPolicy?: UniqueKeyPolicy; /** The conflict resolution policy for the container. */ conflictResolutionPolicy?: ConflictResolutionPolicy; + /** The client encryption policy for the container. */ + clientEncryptionPolicy?: ClientEncryptionPolicy; /** Analytical TTL. */ analyticalStorageTtl?: number; } @@ -986,6 +1013,91 @@ export interface ConflictResolutionPolicy { conflictResolutionProcedure?: string; } +/** Cosmos DB client encryption policy. */ +export interface ClientEncryptionPolicy { + /** Paths of the item that need encryption along with path-specific settings. */ + includedPaths: ClientEncryptionIncludedPath[]; + /** Version of the client encryption policy definition. Please note, user passed value is ignored. Default policy version is 1. */ + policyFormatVersion?: number; +} + +/** . */ +export interface ClientEncryptionIncludedPath { + /** Path that needs to be encrypted. */ + path: string; + /** The identifier of the Client Encryption Key to be used to encrypt the path. */ + clientEncryptionKeyId: string; + /** The type of encryption to be performed. Eg - Deterministic, Randomized. */ + encryptionType: string; + /** The encryption algorithm which will be used. Eg - AEAD_AES_256_CBC_HMAC_SHA256. */ + encryptionAlgorithm: string; +} + +/** The properties of an Azure Cosmos DB merge operations */ +export interface MergeParameters { + /** Specifies whether the operation is a real merge operation or a simulation. */ + isDryRun?: boolean; +} + +/** List of physical partitions and their properties returned by a merge operation. */ +export interface PhysicalPartitionStorageInfoCollection { + /** + * List of physical partitions and their properties. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly physicalPartitionStorageInfoCollection?: PhysicalPartitionStorageInfo[]; +} + +/** The storage of a physical partition */ +export interface PhysicalPartitionStorageInfo { + /** + * The unique identifier of the partition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The storage in KB for the physical partition. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly storageInKB?: number; +} + +/** Resource to retrieve throughput information for Cosmos DB resource */ +export interface RetrieveThroughputPropertiesResource { + /** Array of PhysicalPartitionId objects. */ + physicalPartitionIds: PhysicalPartitionId[]; +} + +/** PhysicalPartitionId object */ +export interface PhysicalPartitionId { + /** Id of a physical partition */ + id: string; +} + +/** The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object */ +export interface PhysicalPartitionThroughputInfoProperties { + /** Array of physical partition throughput info objects */ + physicalPartitionThroughputInfo?: PhysicalPartitionThroughputInfoResource[]; +} + +/** PhysicalPartitionThroughputInfo object */ +export interface PhysicalPartitionThroughputInfoResource { + /** Id of a physical partition */ + id: string; + /** Throughput of a physical partition */ + throughput?: number; +} + +/** Resource to redistribute throughput for Azure Cosmos DB resource */ +export interface RedistributeThroughputPropertiesResource { + /** ThroughputPolicy to apply for throughput redistribution */ + throughputPolicy: ThroughputPolicyType; + /** Array of PhysicalPartitionThroughputInfoResource objects. */ + targetPhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; + /** Array of PhysicalPartitionThroughputInfoResource objects. */ + sourcePhysicalPartitionThroughputInfo: PhysicalPartitionThroughputInfoResource[]; +} + /** The List operation response, that contains the storedProcedures and their properties. */ export interface SqlStoredProcedureListResult { /** @@ -1220,6 +1332,8 @@ export interface GremlinGraphResource { uniqueKeyPolicy?: UniqueKeyPolicy; /** The conflict resolution policy for the graph. */ conflictResolutionPolicy?: ConflictResolutionPolicy; + /** Analytical TTL. */ + analyticalStorageTtl?: number; } /** The List operation response, that contains Cosmos DB locations and their properties. */ @@ -1289,10 +1403,15 @@ export interface DataTransferJobProperties { */ readonly status?: string; /** - * Percentage of completion. + * Processed Count. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentageComplete?: number; + readonly processedCount?: number; + /** + * Total Count. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly totalCount?: number; /** * Last Updated Time (ISO-8601 format). * NOTE: This property will not be serialized. It can only be populated by the server. @@ -1777,6 +1896,8 @@ export interface RestorableDatabaseAccountGetResult { accountName?: string; /** The creation time of the restorable database account (ISO-8601 format). */ creationTime?: Date; + /** The least recent time at which the database account can be restored to (ISO-8601 format). */ + oldestRestorableTime?: Date; /** The time at which the restorable database account has been deleted (ISO-8601 format). */ deletionTime?: Date; /** @@ -1964,7 +2085,30 @@ export interface RestorableSqlResourcesListResult { * List of restorable SQL resources, including the database and collection names. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: DatabaseRestoreResource[]; + readonly value?: RestorableSqlResourcesGetResult[]; +} + +/** Specific Databases to restore. */ +export interface RestorableSqlResourcesGetResult { + /** + * The unique resource identifier of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The name of the database available for restore. */ + databaseName?: string; + /** The names of the collections available for restore. */ + collectionNames?: string[]; } /** The List operation response, that contains the MongoDB database events and their properties. */ @@ -2091,7 +2235,30 @@ export interface RestorableMongodbResourcesListResult { * List of restorable MongoDB resources, including the database and collection names. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: DatabaseRestoreResource[]; + readonly value?: RestorableMongodbResourcesGetResult[]; +} + +/** Specific Databases to restore. */ +export interface RestorableMongodbResourcesGetResult { + /** + * The unique resource identifier of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The name of the database available for restore. */ + databaseName?: string; + /** The names of the collections available for restore. */ + collectionNames?: string[]; } /** The List operation response, that contains the Gremlin database events and their properties. */ @@ -2218,7 +2385,30 @@ export interface RestorableGremlinResourcesListResult { * List of restorable Gremlin resources, including the gremlin database and graph names. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: GremlinDatabaseRestoreResource[]; + readonly value?: RestorableGremlinResourcesGetResult[]; +} + +/** Specific Databases to restore. */ +export interface RestorableGremlinResourcesGetResult { + /** + * The unique resource identifier of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; + /** The name of the gremlin database available for restore. */ + databaseName?: string; + /** The names of the graphs available for restore. */ + graphNames?: string[]; } /** The List operation response, that contains the Table events and their properties. */ @@ -2286,7 +2476,26 @@ export interface RestorableTableResourcesListResult { * List of restorable table names. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly value?: string[]; + readonly value?: RestorableTableResourcesGetResult[]; +} + +/** Specific Databases to restore. */ +export interface RestorableTableResourcesGetResult { + /** + * The unique resource identifier of the ARM resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; + /** + * The name of the Table. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly name?: string; + /** + * The type of Azure resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly type?: string; } /** The List operation response, that contains the Service Resource and their properties. */ @@ -2344,6 +2553,12 @@ export interface PeriodicModeProperties { backupStorageRedundancy?: BackupStorageRedundancy; } +/** Configuration values for periodic mode backup */ +export interface ContinuousModeProperties { + /** Enum to indicate type of Continuos backup mode */ + tier?: ContinuousTier; +} + /** Describes the service response property. */ export interface DataTransferServiceResource { /** Properties for DataTransferServiceResource. */ @@ -2402,6 +2617,8 @@ export type PeriodicModeBackupPolicy = BackupPolicy & { export type ContinuousModeBackupPolicy = BackupPolicy & { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Continuous"; + /** Configuration values for continuous mode backup */ + continuousModeProperties?: ContinuousModeProperties; }; /** An Azure Cosmos DB database account. */ @@ -2512,6 +2729,8 @@ export type DatabaseAccountGetResults = ARMResourceProperties & { capacity?: Capacity; /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; + /** The object that represents the metadata for the Account Keys of the Cosmos DB account. */ + keysMetadata?: DatabaseAccountKeysMetadata; }; /** Parameters to create and update Cosmos DB database accounts. */ @@ -2576,6 +2795,8 @@ export type DatabaseAccountCreateUpdateParameters = ARMResourceProperties & { capacity?: Capacity; /** Flag to indicate whether to enable MaterializedViews on the Cosmos DB account */ enableMaterializedViews?: boolean; + /** This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. */ + keysMetadata?: DatabaseAccountKeysMetadata; }; /** An Azure Cosmos DB Graph resource. */ @@ -2631,6 +2852,24 @@ export type SqlContainerCreateUpdateParameters = ARMResourceProperties & { options?: CreateUpdateOptions; }; +/** Cosmos DB retrieve throughput parameters object */ +export type RetrieveThroughputParameters = ARMResourceProperties & { + /** The standard JSON format of a resource throughput */ + resource: RetrieveThroughputPropertiesResource; +}; + +/** An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ +export type PhysicalPartitionThroughputInfoResult = ARMResourceProperties & { + /** properties of physical partition throughput info */ + resource?: PhysicalPartitionThroughputInfoResultPropertiesResource; +}; + +/** Cosmos DB redistribute throughput parameters object */ +export type RedistributeThroughputParameters = ARMResourceProperties & { + /** The standard JSON format of a resource throughput */ + resource: RedistributeThroughputPropertiesResource; +}; + /** An Azure Cosmos DB storedProcedure. */ export type SqlStoredProcedureGetResults = ARMResourceProperties & { resource?: SqlStoredProcedureGetPropertiesResource; @@ -3001,10 +3240,15 @@ export type DataTransferJobGetResults = ARMProxyResource & { */ readonly status?: string; /** - * Percentage of completion. + * Processed Count. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly processedCount?: number; + /** + * Total Count. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly percentageComplete?: number; + readonly totalCount?: number; /** * Last Updated Time (ISO-8601 format). * NOTE: This property will not be serialized. It can only be populated by the server. @@ -3124,6 +3368,9 @@ export type ServiceResource = ARMProxyResource & { properties?: ServiceResourcePropertiesUnion; }; +/** properties of physical partition throughput info */ +export type PhysicalPartitionThroughputInfoResultPropertiesResource = PhysicalPartitionThroughputInfoProperties & {}; + /** A CosmosDB Cassandra API data source/sink */ export type CosmosCassandraDataTransferDataSourceSink = DataTransferDataSourceSink & { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -3290,7 +3537,8 @@ export type PublicNetworkAccess = string; export enum KnownServerVersion { Three2 = "3.2", Three6 = "3.6", - Four0 = "4.0" + Four0 = "4.0", + Four2 = "4.2" } /** @@ -3300,7 +3548,8 @@ export enum KnownServerVersion { * ### Known values supported by the service * **3.2** \ * **3.6** \ - * **4.0** + * **4.0** \ + * **4.2** */ export type ServerVersion = string; @@ -3606,6 +3855,24 @@ export enum KnownConflictResolutionMode { */ export type ConflictResolutionMode = string; +/** Known values of {@link ThroughputPolicyType} that the service accepts. */ +export enum KnownThroughputPolicyType { + None = "none", + Equal = "equal", + Custom = "custom" +} + +/** + * Defines values for ThroughputPolicyType. \ + * {@link KnownThroughputPolicyType} can be used interchangeably with ThroughputPolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **none** \ + * **equal** \ + * **custom** + */ +export type ThroughputPolicyType = string; + /** Known values of {@link TriggerType} that the service accepts. */ export enum KnownTriggerType { Pre = "Pre", @@ -3904,6 +4171,22 @@ export enum KnownServiceStatus { */ export type ServiceStatus = string; +/** Known values of {@link ContinuousTier} that the service accepts. */ +export enum KnownContinuousTier { + Continuous7Days = "Continuous7Days", + Continuous30Days = "Continuous30Days" +} + +/** + * Defines values for ContinuousTier. \ + * {@link KnownContinuousTier} can be used interchangeably with ContinuousTier, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Continuous7Days** \ + * **Continuous30Days** + */ +export type ContinuousTier = string; + /** Known values of {@link NodeStatus} that the service accepts. */ export enum KnownNodeStatus { Up = "Up", @@ -4401,6 +4684,18 @@ export interface SqlResourcesDeleteSqlContainerOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface SqlResourcesListSqlContainerPartitionMergeOptionalParams + 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; +} + +/** Contains response data for the listSqlContainerPartitionMerge operation. */ +export type SqlResourcesListSqlContainerPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + /** Optional parameters. */ export interface SqlResourcesGetSqlContainerThroughputOptionalParams extends coreClient.OperationOptions {} @@ -4444,6 +4739,30 @@ export interface SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams /** Contains response data for the migrateSqlContainerToManualThroughput operation. */ export type SqlResourcesMigrateSqlContainerToManualThroughputResponse = ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + 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; +} + +/** Contains response data for the sqlContainerRetrieveThroughputDistribution operation. */ +export type SqlResourcesSqlContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + +/** Optional parameters. */ +export interface SqlResourcesSqlContainerRedistributeThroughputOptionalParams + 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; +} + +/** Contains response data for the sqlContainerRedistributeThroughput operation. */ +export type SqlResourcesSqlContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + /** Optional parameters. */ export interface SqlResourcesListSqlStoredProceduresOptionalParams extends coreClient.OperationOptions {} @@ -4709,6 +5028,30 @@ export interface MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptiona /** Contains response data for the migrateMongoDBDatabaseToManualThroughput operation. */ export type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse = ThroughputSettingsGetResults; +/** Optional parameters. */ +export interface MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + 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; +} + +/** Contains response data for the mongoDBContainerRetrieveThroughputDistribution operation. */ +export type MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse = PhysicalPartitionThroughputInfoResult; + +/** Optional parameters. */ +export interface MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + 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; +} + +/** Contains response data for the mongoDBContainerRedistributeThroughput operation. */ +export type MongoDBResourcesMongoDBContainerRedistributeThroughputResponse = PhysicalPartitionThroughputInfoResult; + /** Optional parameters. */ export interface MongoDBResourcesListMongoDBCollectionsOptionalParams extends coreClient.OperationOptions {} @@ -4744,6 +5087,18 @@ export interface MongoDBResourcesDeleteMongoDBCollectionOptionalParams resumeFrom?: string; } +/** Optional parameters. */ +export interface MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + 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; +} + +/** Contains response data for the listMongoDBCollectionPartitionMerge operation. */ +export type MongoDBResourcesListMongoDBCollectionPartitionMergeResponse = PhysicalPartitionStorageInfoCollection; + /** Optional parameters. */ export interface MongoDBResourcesGetMongoDBCollectionThroughputOptionalParams extends coreClient.OperationOptions {} @@ -5389,6 +5744,27 @@ export interface DataTransferJobsGetOptionalParams /** Contains response data for the get operation. */ export type DataTransferJobsGetResponse = DataTransferJobGetResults; +/** Optional parameters. */ +export interface DataTransferJobsPauseOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the pause operation. */ +export type DataTransferJobsPauseResponse = DataTransferJobGetResults; + +/** Optional parameters. */ +export interface DataTransferJobsResumeOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the resume operation. */ +export type DataTransferJobsResumeResponse = DataTransferJobGetResults; + +/** Optional parameters. */ +export interface DataTransferJobsCancelOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the cancel operation. */ +export type DataTransferJobsCancelResponse = DataTransferJobGetResults; + /** Optional parameters. */ export interface DataTransferJobsListByDatabaseAccountOptionalParams extends coreClient.OperationOptions {} diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts index 186f45b7340f..c35954739506 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts @@ -534,6 +534,59 @@ export const Capacity: coreClient.CompositeMapper = { } }; +export const DatabaseAccountKeysMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "DatabaseAccountKeysMetadata", + modelProperties: { + primaryMasterKey: { + serializedName: "primaryMasterKey", + type: { + name: "Composite", + className: "AccountKeyMetadata" + } + }, + secondaryMasterKey: { + serializedName: "secondaryMasterKey", + type: { + name: "Composite", + className: "AccountKeyMetadata" + } + }, + primaryReadonlyMasterKey: { + serializedName: "primaryReadonlyMasterKey", + type: { + name: "Composite", + className: "AccountKeyMetadata" + } + }, + secondaryReadonlyMasterKey: { + serializedName: "secondaryReadonlyMasterKey", + type: { + name: "Composite", + className: "AccountKeyMetadata" + } + } + } + } +}; + +export const AccountKeyMetadata: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountKeyMetadata", + modelProperties: { + generationTime: { + serializedName: "generationTime", + readOnly: true, + type: { + name: "DateTime" + } + } + } + } +}; + export const SystemData: coreClient.CompositeMapper = { type: { name: "Composite", @@ -923,6 +976,13 @@ export const DatabaseAccountUpdateParameters: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + keysMetadata: { + serializedName: "properties.keysMetadata", + type: { + name: "Composite", + className: "DatabaseAccountKeysMetadata" + } } } } @@ -1973,6 +2033,12 @@ export const KeyWrapMetadata: coreClient.CompositeMapper = { type: { name: "String" } + }, + algorithm: { + serializedName: "algorithm", + type: { + name: "String" + } } } } @@ -2092,6 +2158,13 @@ export const SqlContainerResource: coreClient.CompositeMapper = { className: "ConflictResolutionPolicy" } }, + clientEncryptionPolicy: { + serializedName: "clientEncryptionPolicy", + type: { + name: "Composite", + className: "ClientEncryptionPolicy" + } + }, analyticalStorageTtl: { serializedName: "analyticalStorageTtl", type: { @@ -2408,6 +2481,255 @@ export const ConflictResolutionPolicy: coreClient.CompositeMapper = { } }; +export const ClientEncryptionPolicy: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClientEncryptionPolicy", + modelProperties: { + includedPaths: { + serializedName: "includedPaths", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClientEncryptionIncludedPath" + } + } + } + }, + policyFormatVersion: { + defaultValue: 1, + serializedName: "policyFormatVersion", + type: { + name: "Number" + } + } + } + } +}; + +export const ClientEncryptionIncludedPath: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ClientEncryptionIncludedPath", + modelProperties: { + path: { + serializedName: "path", + required: true, + type: { + name: "String" + } + }, + clientEncryptionKeyId: { + serializedName: "clientEncryptionKeyId", + required: true, + type: { + name: "String" + } + }, + encryptionType: { + serializedName: "encryptionType", + required: true, + type: { + name: "String" + } + }, + encryptionAlgorithm: { + serializedName: "encryptionAlgorithm", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const MergeParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MergeParameters", + modelProperties: { + isDryRun: { + serializedName: "isDryRun", + type: { + name: "Boolean" + } + } + } + } +}; + +export const PhysicalPartitionStorageInfoCollection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionStorageInfoCollection", + modelProperties: { + physicalPartitionStorageInfoCollection: { + serializedName: "physicalPartitionStorageInfoCollection", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhysicalPartitionStorageInfo" + } + } + } + } + } + } +}; + +export const PhysicalPartitionStorageInfo: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionStorageInfo", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + storageInKB: { + serializedName: "storageInKB", + readOnly: true, + type: { + name: "Number" + } + } + } + } +}; + +export const RetrieveThroughputPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RetrieveThroughputPropertiesResource", + modelProperties: { + physicalPartitionIds: { + serializedName: "physicalPartitionIds", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhysicalPartitionId" + } + } + } + } + } + } +}; + +export const PhysicalPartitionId: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionId", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + } + } + } +}; + +export const PhysicalPartitionThroughputInfoProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoProperties", + modelProperties: { + physicalPartitionThroughputInfo: { + serializedName: "physicalPartitionThroughputInfo", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResource" + } + } + } + } + } + } +}; + +export const PhysicalPartitionThroughputInfoResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResource", + modelProperties: { + id: { + serializedName: "id", + required: true, + type: { + name: "String" + } + }, + throughput: { + serializedName: "throughput", + type: { + name: "Number" + } + } + } + } +}; + +export const RedistributeThroughputPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedistributeThroughputPropertiesResource", + modelProperties: { + throughputPolicy: { + serializedName: "throughputPolicy", + required: true, + type: { + name: "String" + } + }, + targetPhysicalPartitionThroughputInfo: { + serializedName: "targetPhysicalPartitionThroughputInfo", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResource" + } + } + } + }, + sourcePhysicalPartitionThroughputInfo: { + serializedName: "sourcePhysicalPartitionThroughputInfo", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResource" + } + } + } + } + } + } +}; + export const SqlStoredProcedureListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3057,6 +3379,12 @@ export const GremlinGraphResource: coreClient.CompositeMapper = { name: "Composite", className: "ConflictResolutionPolicy" } + }, + analyticalStorageTtl: { + serializedName: "analyticalStorageTtl", + type: { + name: "Number" + } } } } @@ -3204,8 +3532,15 @@ export const DataTransferJobProperties: coreClient.CompositeMapper = { name: "String" } }, - percentageComplete: { - serializedName: "percentageComplete", + processedCount: { + serializedName: "processedCount", + readOnly: true, + type: { + name: "Number" + } + }, + totalCount: { + serializedName: "totalCount", readOnly: true, type: { name: "Number" @@ -4610,6 +4945,12 @@ export const RestorableDatabaseAccountGetResult: coreClient.CompositeMapper = { name: "DateTime" } }, + oldestRestorableTime: { + serializedName: "properties.oldestRestorableTime", + type: { + name: "DateTime" + } + }, deletionTime: { serializedName: "properties.deletionTime", type: { @@ -4956,7 +5297,54 @@ export const RestorableSqlResourcesListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "DatabaseRestoreResource" + className: "RestorableSqlResourcesGetResult" + } + } + } + } + } + } +}; + +export const RestorableSqlResourcesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableSqlResourcesGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + databaseName: { + serializedName: "databaseName", + type: { + name: "String" + } + }, + collectionNames: { + serializedName: "collectionNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } @@ -5184,7 +5572,54 @@ export const RestorableMongodbResourcesListResult: coreClient.CompositeMapper = element: { type: { name: "Composite", - className: "DatabaseRestoreResource" + className: "RestorableMongodbResourcesGetResult" + } + } + } + } + } + } +}; + +export const RestorableMongodbResourcesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableMongodbResourcesGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + databaseName: { + serializedName: "databaseName", + type: { + name: "String" + } + }, + collectionNames: { + serializedName: "collectionNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } @@ -5412,7 +5847,54 @@ export const RestorableGremlinResourcesListResult: coreClient.CompositeMapper = element: { type: { name: "Composite", - className: "GremlinDatabaseRestoreResource" + className: "RestorableGremlinResourcesGetResult" + } + } + } + } + } + } +}; + +export const RestorableGremlinResourcesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableGremlinResourcesGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + }, + databaseName: { + serializedName: "databaseName", + type: { + name: "String" + } + }, + graphNames: { + serializedName: "graphNames", + type: { + name: "Sequence", + element: { + type: { + name: "String" } } } @@ -5536,7 +6018,8 @@ export const RestorableTableResourcesListResult: coreClient.CompositeMapper = { name: "Sequence", element: { type: { - name: "String" + name: "Composite", + className: "RestorableTableResourcesGetResult" } } } @@ -5545,6 +6028,36 @@ export const RestorableTableResourcesListResult: coreClient.CompositeMapper = { } }; +export const RestorableTableResourcesGetResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RestorableTableResourcesGetResult", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + }, + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String" + } + }, + type: { + serializedName: "type", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const ServiceResourceListResult: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5682,6 +6195,21 @@ export const PeriodicModeProperties: coreClient.CompositeMapper = { } }; +export const ContinuousModeProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ContinuousModeProperties", + modelProperties: { + tier: { + serializedName: "tier", + type: { + name: "String" + } + } + } + } +}; + export const DataTransferServiceResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -5814,7 +6342,14 @@ export const ContinuousModeBackupPolicy: coreClient.CompositeMapper = { uberParent: "BackupPolicy", polymorphicDiscriminator: BackupPolicy.type.polymorphicDiscriminator, modelProperties: { - ...BackupPolicy.type.modelProperties + ...BackupPolicy.type.modelProperties, + continuousModeProperties: { + serializedName: "continuousModeProperties", + type: { + name: "Composite", + className: "ContinuousModeProperties" + } + } } } }; @@ -6131,6 +6666,13 @@ export const DatabaseAccountGetResults: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + keysMetadata: { + serializedName: "properties.keysMetadata", + type: { + name: "Composite", + className: "DatabaseAccountKeysMetadata" + } } } } @@ -6368,6 +6910,13 @@ export const DatabaseAccountCreateUpdateParameters: coreClient.CompositeMapper = type: { name: "Boolean" } + }, + keysMetadata: { + serializedName: "properties.keysMetadata", + type: { + name: "Composite", + className: "DatabaseAccountKeysMetadata" + } } } } @@ -6551,6 +7100,57 @@ export const SqlContainerCreateUpdateParameters: coreClient.CompositeMapper = { } }; +export const RetrieveThroughputParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RetrieveThroughputParameters", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RetrieveThroughputPropertiesResource" + } + } + } + } +}; + +export const PhysicalPartitionThroughputInfoResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResult", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResultPropertiesResource" + } + } + } + } +}; + +export const RedistributeThroughputParameters: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "RedistributeThroughputParameters", + modelProperties: { + ...ARMResourceProperties.type.modelProperties, + resource: { + serializedName: "properties.resource", + type: { + name: "Composite", + className: "RedistributeThroughputPropertiesResource" + } + } + } + } +}; + export const SqlStoredProcedureGetResults: coreClient.CompositeMapper = { type: { name: "Composite", @@ -7621,8 +8221,15 @@ export const DataTransferJobGetResults: coreClient.CompositeMapper = { name: "String" } }, - percentageComplete: { - serializedName: "properties.percentageComplete", + processedCount: { + serializedName: "properties.processedCount", + readOnly: true, + type: { + name: "Number" + } + }, + totalCount: { + serializedName: "properties.totalCount", readOnly: true, type: { name: "Number" @@ -7960,6 +8567,16 @@ export const ServiceResource: coreClient.CompositeMapper = { } }; +export const PhysicalPartitionThroughputInfoResultPropertiesResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PhysicalPartitionThroughputInfoResultPropertiesResource", + modelProperties: { + ...PhysicalPartitionThroughputInfoProperties.type.modelProperties + } + } +}; + export const CosmosCassandraDataTransferDataSourceSink: coreClient.CompositeMapper = { serializedName: "CosmosDBCassandra", type: { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts index ed70e2586d6c..4d3fcf5d4d44 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/parameters.ts @@ -22,6 +22,9 @@ import { ThroughputSettingsUpdateParameters as ThroughputSettingsUpdateParametersMapper, ClientEncryptionKeyCreateUpdateParameters as ClientEncryptionKeyCreateUpdateParametersMapper, SqlContainerCreateUpdateParameters as SqlContainerCreateUpdateParametersMapper, + MergeParameters as MergeParametersMapper, + RetrieveThroughputParameters as RetrieveThroughputParametersMapper, + RedistributeThroughputParameters as RedistributeThroughputParametersMapper, SqlStoredProcedureCreateUpdateParameters as SqlStoredProcedureCreateUpdateParametersMapper, SqlUserDefinedFunctionCreateUpdateParameters as SqlUserDefinedFunctionCreateUpdateParametersMapper, SqlTriggerCreateUpdateParameters as SqlTriggerCreateUpdateParametersMapper, @@ -119,7 +122,7 @@ export const accountName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2021-11-15-preview", + defaultValue: "2022-05-15-preview", isConstant: true, serializedName: "api-version", type: { @@ -338,6 +341,21 @@ export const createUpdateSqlContainerParameters: OperationParameter = { mapper: SqlContainerCreateUpdateParametersMapper }; +export const mergeParameters: OperationParameter = { + parameterPath: "mergeParameters", + mapper: MergeParametersMapper +}; + +export const retrieveThroughputParameters: OperationParameter = { + parameterPath: "retrieveThroughputParameters", + mapper: RetrieveThroughputParametersMapper +}; + +export const redistributeThroughputParameters: OperationParameter = { + parameterPath: "redistributeThroughputParameters", + mapper: RedistributeThroughputParametersMapper +}; + export const storedProcedureName: OperationURLParameter = { parameterPath: "storedProcedureName", mapper: { diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts index 2161c154dd36..72bd5426c53e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/dataTransferJobs.ts @@ -21,6 +21,12 @@ import { DataTransferJobsCreateResponse, DataTransferJobsGetOptionalParams, DataTransferJobsGetResponse, + DataTransferJobsPauseOptionalParams, + DataTransferJobsPauseResponse, + DataTransferJobsResumeOptionalParams, + DataTransferJobsResumeResponse, + DataTransferJobsCancelOptionalParams, + DataTransferJobsCancelResponse, DataTransferJobsListByDatabaseAccountResponse, DataTransferJobsListByDatabaseAccountNextResponse } from "../models"; @@ -149,6 +155,63 @@ export class DataTransferJobsImpl implements DataTransferJobs { ); } + /** + * Pause a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + pause( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsPauseOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, options }, + pauseOperationSpec + ); + } + + /** + * Resumes a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + resume( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsResumeOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, options }, + resumeOperationSpec + ); + } + + /** + * Cancels a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + cancel( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsCancelOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, jobName, options }, + cancelOperationSpec + ); + } + /** * Get a list of Data Transfer jobs. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -193,7 +256,7 @@ const createOperationSpec: coreClient.OperationSpec = { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", httpMethod: "PUT", responses: { - 201: { + 200: { bodyMapper: Mappers.DataTransferJobGetResults }, default: { @@ -236,6 +299,75 @@ const getOperationSpec: coreClient.OperationSpec = { headerParameters: [Parameters.accept], serializer }; +const pauseOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], + serializer +}; +const resumeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], + serializer +}; +const cancelOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.DataTransferJobGetResults + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.jobName + ], + headerParameters: [Parameters.accept], + serializer +}; const listByDatabaseAccountOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts index c0c0d5c25251..c57d97ffce0e 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/mongoDBResources.ts @@ -39,6 +39,12 @@ import { MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleResponse, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse, + RetrieveThroughputParameters, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse, MongoDBResourcesListMongoDBCollectionsResponse, MongoDBResourcesGetMongoDBCollectionOptionalParams, MongoDBResourcesGetMongoDBCollectionResponse, @@ -46,6 +52,9 @@ import { MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, MongoDBResourcesCreateUpdateMongoDBCollectionResponse, MongoDBResourcesDeleteMongoDBCollectionOptionalParams, + MergeParameters, + MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse, MongoDBResourcesGetMongoDBCollectionThroughputOptionalParams, MongoDBResourcesGetMongoDBCollectionThroughputResponse, MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams, @@ -878,6 +887,236 @@ export class MongoDBResourcesImpl implements MongoDBResources { return poller.pollUntilDone(); } + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB container. + * @param options The options parameters. + */ + async beginMongoDBContainerRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + >, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + options + }, + mongoDBContainerRetrieveThroughputDistributionOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB container. + * @param options The options parameters. + */ + async beginMongoDBContainerRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + > { + const poller = await this.beginMongoDBContainerRetrieveThroughputDistribution( + resourceGroupName, + accountName, + databaseName, + collectionName, + retrieveThroughputParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB container. + * @param options The options parameters. + */ + async beginMongoDBContainerRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + >, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + collectionName, + redistributeThroughputParameters, + options + }, + mongoDBContainerRedistributeThroughputOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB container. + * @param options The options parameters. + */ + async beginMongoDBContainerRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + ): Promise { + const poller = await this.beginMongoDBContainerRedistributeThroughput( + resourceGroupName, + accountName, + databaseName, + collectionName, + redistributeThroughputParameters, + options + ); + return poller.pollUntilDone(); + } + /** * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1121,6 +1360,118 @@ export class MongoDBResourcesImpl implements MongoDBResources { return poller.pollUntilDone(); } + /** + * Merges the partitions of a MongoDB Collection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + async beginListMongoDBCollectionPartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse + >, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + collectionName, + mergeParameters, + options + }, + listMongoDBCollectionPartitionMergeOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Merges the partitions of a MongoDB Collection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + async beginListMongoDBCollectionPartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + ): Promise { + const poller = await this.beginListMongoDBCollectionPartitionMerge( + resourceGroupName, + accountName, + databaseName, + collectionName, + mergeParameters, + options + ); + return poller.pollUntilDone(); + } + /** * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account * with the provided name. @@ -2234,6 +2585,76 @@ const migrateMongoDBDatabaseToManualThroughputOperationSpec: coreClient.Operatio headerParameters: [Parameters.accept], serializer }; +const mongoDBContainerRetrieveThroughputDistributionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.retrieveThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const mongoDBContainerRedistributeThroughputOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.redistributeThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listMongoDBCollectionsOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections", @@ -2323,6 +2744,41 @@ const deleteMongoDBCollectionOperationSpec: coreClient.OperationSpec = { ], serializer }; +const listMongoDBCollectionPartitionMergeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.mergeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.collectionName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const getMongoDBCollectionThroughputOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts index c815ae12294e..f3fbacef2ac5 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableGremlinResources.ts @@ -13,7 +13,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; import { - GremlinDatabaseRestoreResource, + RestorableGremlinResourcesGetResult, RestorableGremlinResourcesListOptionalParams, RestorableGremlinResourcesListResponse } from "../models"; @@ -45,7 +45,7 @@ export class RestorableGremlinResourcesImpl location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, instanceId, options); return { next() { @@ -64,7 +64,7 @@ export class RestorableGremlinResourcesImpl location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._list(location, instanceId, options); yield result.value || []; } @@ -73,7 +73,7 @@ export class RestorableGremlinResourcesImpl location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage( location, instanceId, diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts index e0d2231a5bda..d9fdf16abf94 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableMongodbResources.ts @@ -13,7 +13,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; import { - DatabaseRestoreResource, + RestorableMongodbResourcesGetResult, RestorableMongodbResourcesListOptionalParams, RestorableMongodbResourcesListResponse } from "../models"; @@ -44,7 +44,7 @@ export class RestorableMongodbResourcesImpl location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, instanceId, options); return { next() { @@ -63,7 +63,7 @@ export class RestorableMongodbResourcesImpl location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._list(location, instanceId, options); yield result.value || []; } @@ -72,7 +72,7 @@ export class RestorableMongodbResourcesImpl location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage( location, instanceId, diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts index 930923305575..acdb0e2b59e6 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableSqlResources.ts @@ -13,7 +13,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; import { - DatabaseRestoreResource, + RestorableSqlResourcesGetResult, RestorableSqlResourcesListOptionalParams, RestorableSqlResourcesListResponse } from "../models"; @@ -43,7 +43,7 @@ export class RestorableSqlResourcesImpl implements RestorableSqlResources { location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, instanceId, options); return { next() { @@ -62,7 +62,7 @@ export class RestorableSqlResourcesImpl implements RestorableSqlResources { location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._list(location, instanceId, options); yield result.value || []; } @@ -71,7 +71,7 @@ export class RestorableSqlResourcesImpl implements RestorableSqlResources { location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage( location, instanceId, diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts index 12d26ce2cc07..f741acc2ae6d 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/restorableTableResources.ts @@ -13,6 +13,7 @@ import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { CosmosDBManagementClient } from "../cosmosDBManagementClient"; import { + RestorableTableResourcesGetResult, RestorableTableResourcesListOptionalParams, RestorableTableResourcesListResponse } from "../models"; @@ -42,7 +43,7 @@ export class RestorableTableResourcesImpl implements RestorableTableResources { location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams - ): PagedAsyncIterableIterator { + ): PagedAsyncIterableIterator { const iter = this.listPagingAll(location, instanceId, options); return { next() { @@ -61,7 +62,7 @@ export class RestorableTableResourcesImpl implements RestorableTableResources { location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { let result = await this._list(location, instanceId, options); yield result.value || []; } @@ -70,7 +71,7 @@ export class RestorableTableResourcesImpl implements RestorableTableResources { location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams - ): AsyncIterableIterator { + ): AsyncIterableIterator { for await (const page of this.listPagingPage( location, instanceId, diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts index cea13b49a4f7..2820e9c78470 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operations/sqlResources.ts @@ -60,6 +60,9 @@ import { SqlResourcesCreateUpdateSqlContainerOptionalParams, SqlResourcesCreateUpdateSqlContainerResponse, SqlResourcesDeleteSqlContainerOptionalParams, + MergeParameters, + SqlResourcesListSqlContainerPartitionMergeOptionalParams, + SqlResourcesListSqlContainerPartitionMergeResponse, SqlResourcesGetSqlContainerThroughputOptionalParams, SqlResourcesGetSqlContainerThroughputResponse, SqlResourcesUpdateSqlContainerThroughputOptionalParams, @@ -68,6 +71,12 @@ import { SqlResourcesMigrateSqlContainerToAutoscaleResponse, SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams, SqlResourcesMigrateSqlContainerToManualThroughputResponse, + RetrieveThroughputParameters, + SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + SqlResourcesSqlContainerRedistributeThroughputOptionalParams, + SqlResourcesSqlContainerRedistributeThroughputResponse, SqlResourcesListSqlStoredProceduresResponse, SqlResourcesGetSqlStoredProcedureOptionalParams, SqlResourcesGetSqlStoredProcedureResponse, @@ -1602,6 +1611,116 @@ export class SqlResourcesImpl implements SqlResources { return poller.pollUntilDone(); } + /** + * Merges the partitions of a SQL Container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + async beginListSqlContainerPartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlResourcesListSqlContainerPartitionMergeResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + options + }, + listSqlContainerPartitionMergeOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Merges the partitions of a SQL Container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + async beginListSqlContainerPartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams + ): Promise { + const poller = await this.beginListSqlContainerPartitionMerge( + resourceGroupName, + accountName, + databaseName, + containerName, + mergeParameters, + options + ); + return poller.pollUntilDone(); + } + /** * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -1930,6 +2049,234 @@ export class SqlResourcesImpl implements SqlResources { return poller.pollUntilDone(); } + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. + * @param options The options parameters. + */ + async beginSqlContainerRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse + >, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + containerName, + retrieveThroughputParameters, + options + }, + sqlContainerRetrieveThroughputDistributionOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. + * @param options The options parameters. + */ + async beginSqlContainerRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + ): Promise { + const poller = await this.beginSqlContainerRetrieveThroughputDistribution( + resourceGroupName, + accountName, + databaseName, + containerName, + retrieveThroughputParameters, + options + ); + return poller.pollUntilDone(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. + * @param options The options parameters. + */ + async beginSqlContainerRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SqlResourcesSqlContainerRedistributeThroughputResponse + >, + SqlResourcesSqlContainerRedistributeThroughputResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, + { + resourceGroupName, + accountName, + databaseName, + containerName, + redistributeThroughputParameters, + options + }, + sqlContainerRedistributeThroughputOperationSpec + ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + lroResourceLocationConfig: "location" + }); + await poller.poll(); + return poller; + } + + /** + * Redistribute throughput for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. + * @param options The options parameters. + */ + async beginSqlContainerRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams + ): Promise { + const poller = await this.beginSqlContainerRedistributeThroughput( + resourceGroupName, + accountName, + databaseName, + containerName, + redistributeThroughputParameters, + options + ); + return poller.pollUntilDone(); + } + /** * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -3679,6 +4026,41 @@ const deleteSqlContainerOperationSpec: coreClient.OperationSpec = { ], serializer }; +const listSqlContainerPartitionMergeOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionStorageInfoCollection + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.mergeParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const getSqlContainerThroughputOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", @@ -3798,6 +4180,76 @@ const migrateSqlContainerToManualThroughputOperationSpec: coreClient.OperationSp headerParameters: [Parameters.accept], serializer }; +const sqlContainerRetrieveThroughputDistributionOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.retrieveThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const sqlContainerRedistributeThroughputOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 201: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 202: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + 204: { + bodyMapper: Mappers.PhysicalPartitionThroughputInfoResult + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.redistributeThroughputParameters, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.databaseName, + Parameters.containerName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; const listSqlStoredProceduresOperationSpec: coreClient.OperationSpec = { path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts index 0d1f0d07b367..ba391a27b49f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/dataTransferJobs.ts @@ -14,7 +14,13 @@ import { DataTransferJobsCreateOptionalParams, DataTransferJobsCreateResponse, DataTransferJobsGetOptionalParams, - DataTransferJobsGetResponse + DataTransferJobsGetResponse, + DataTransferJobsPauseOptionalParams, + DataTransferJobsPauseResponse, + DataTransferJobsResumeOptionalParams, + DataTransferJobsResumeResponse, + DataTransferJobsCancelOptionalParams, + DataTransferJobsCancelResponse } from "../models"; /// @@ -59,4 +65,43 @@ export interface DataTransferJobs { jobName: string, options?: DataTransferJobsGetOptionalParams ): Promise; + /** + * Pause a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + pause( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsPauseOptionalParams + ): Promise; + /** + * Resumes a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + resume( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsResumeOptionalParams + ): Promise; + /** + * Cancels a Data Transfer Job. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job + * @param options The options parameters. + */ + cancel( + resourceGroupName: string, + accountName: string, + jobName: string, + options?: DataTransferJobsCancelOptionalParams + ): Promise; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts index 818a969142b0..4e1f6ad6248c 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/mongoDBResources.ts @@ -32,12 +32,21 @@ import { MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleResponse, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams, MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputResponse, + RetrieveThroughputParameters, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse, MongoDBResourcesGetMongoDBCollectionOptionalParams, MongoDBResourcesGetMongoDBCollectionResponse, MongoDBCollectionCreateUpdateParameters, MongoDBResourcesCreateUpdateMongoDBCollectionOptionalParams, MongoDBResourcesCreateUpdateMongoDBCollectionResponse, MongoDBResourcesDeleteMongoDBCollectionOptionalParams, + MergeParameters, + MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse, MongoDBResourcesGetMongoDBCollectionThroughputOptionalParams, MongoDBResourcesGetMongoDBCollectionThroughputResponse, MongoDBResourcesUpdateMongoDBCollectionThroughputOptionalParams, @@ -308,6 +317,94 @@ export interface MongoDBResources { databaseName: string, options?: MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputOptionalParams ): Promise; + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB container. + * @param options The options parameters. + */ + beginMongoDBContainerRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + >, + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + > + >; + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current MongoDB container. + * @param options The options parameters. + */ + beginMongoDBContainerRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + MongoDBResourcesMongoDBContainerRetrieveThroughputDistributionResponse + >; + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB container. + * @param options The options parameters. + */ + beginMongoDBContainerRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + >, + MongoDBResourcesMongoDBContainerRedistributeThroughputResponse + > + >; + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current MongoDB container. + * @param options The options parameters. + */ + beginMongoDBContainerRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: MongoDBResourcesMongoDBContainerRedistributeThroughputOptionalParams + ): Promise; /** * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -394,6 +491,47 @@ export interface MongoDBResources { collectionName: string, options?: MongoDBResourcesDeleteMongoDBCollectionOptionalParams ): Promise; + /** + * Merges the partitions of a MongoDB Collection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginListMongoDBCollectionPartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + ): Promise< + PollerLike< + PollOperationState< + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse + >, + MongoDBResourcesListMongoDBCollectionPartitionMergeResponse + > + >; + /** + * Merges the partitions of a MongoDB Collection + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginListMongoDBCollectionPartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + collectionName: string, + mergeParameters: MergeParameters, + options?: MongoDBResourcesListMongoDBCollectionPartitionMergeOptionalParams + ): Promise; /** * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account * with the provided name. diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts index 03a6bb59a335..435170af845f 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableGremlinResources.ts @@ -8,7 +8,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - GremlinDatabaseRestoreResource, + RestorableGremlinResourcesGetResult, RestorableGremlinResourcesListOptionalParams } from "../models"; @@ -28,5 +28,5 @@ export interface RestorableGremlinResources { location: string, instanceId: string, options?: RestorableGremlinResourcesListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts index 45002e285077..946dadbead18 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableMongodbResources.ts @@ -8,7 +8,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - DatabaseRestoreResource, + RestorableMongodbResourcesGetResult, RestorableMongodbResourcesListOptionalParams } from "../models"; @@ -27,5 +27,5 @@ export interface RestorableMongodbResources { location: string, instanceId: string, options?: RestorableMongodbResourcesListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts index 695d9967112a..9b7cc307dc6a 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableSqlResources.ts @@ -8,7 +8,7 @@ import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - DatabaseRestoreResource, + RestorableSqlResourcesGetResult, RestorableSqlResourcesListOptionalParams } from "../models"; @@ -27,5 +27,5 @@ export interface RestorableSqlResources { location: string, instanceId: string, options?: RestorableSqlResourcesListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts index c3d8b2578e24..bbc9b3c588b9 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/restorableTableResources.ts @@ -7,7 +7,10 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { RestorableTableResourcesListOptionalParams } from "../models"; +import { + RestorableTableResourcesGetResult, + RestorableTableResourcesListOptionalParams +} from "../models"; /// /** Interface representing a RestorableTableResources. */ @@ -24,5 +27,5 @@ export interface RestorableTableResources { location: string, instanceId: string, options?: RestorableTableResourcesListOptionalParams - ): PagedAsyncIterableIterator; + ): PagedAsyncIterableIterator; } diff --git a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts index 2a33b0cd3c31..3007a4214824 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/operationsInterfaces/sqlResources.ts @@ -51,6 +51,9 @@ import { SqlResourcesCreateUpdateSqlContainerOptionalParams, SqlResourcesCreateUpdateSqlContainerResponse, SqlResourcesDeleteSqlContainerOptionalParams, + MergeParameters, + SqlResourcesListSqlContainerPartitionMergeOptionalParams, + SqlResourcesListSqlContainerPartitionMergeResponse, SqlResourcesGetSqlContainerThroughputOptionalParams, SqlResourcesGetSqlContainerThroughputResponse, SqlResourcesUpdateSqlContainerThroughputOptionalParams, @@ -59,6 +62,12 @@ import { SqlResourcesMigrateSqlContainerToAutoscaleResponse, SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams, SqlResourcesMigrateSqlContainerToManualThroughputResponse, + RetrieveThroughputParameters, + SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse, + RedistributeThroughputParameters, + SqlResourcesSqlContainerRedistributeThroughputOptionalParams, + SqlResourcesSqlContainerRedistributeThroughputResponse, SqlResourcesGetSqlStoredProcedureOptionalParams, SqlResourcesGetSqlStoredProcedureResponse, SqlStoredProcedureCreateUpdateParameters, @@ -532,6 +541,45 @@ export interface SqlResources { containerName: string, options?: SqlResourcesDeleteSqlContainerOptionalParams ): Promise; + /** + * Merges the partitions of a SQL Container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginListSqlContainerPartitionMerge( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams + ): Promise< + PollerLike< + PollOperationState, + SqlResourcesListSqlContainerPartitionMergeResponse + > + >; + /** + * Merges the partitions of a SQL Container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param mergeParameters The parameters for the merge operation. + * @param options The options parameters. + */ + beginListSqlContainerPartitionMergeAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + mergeParameters: MergeParameters, + options?: SqlResourcesListSqlContainerPartitionMergeOptionalParams + ): Promise; /** * Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. @@ -660,6 +708,92 @@ export interface SqlResources { containerName: string, options?: SqlResourcesMigrateSqlContainerToManualThroughputOptionalParams ): Promise; + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. + * @param options The options parameters. + */ + beginSqlContainerRetrieveThroughputDistribution( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse + >, + SqlResourcesSqlContainerRetrieveThroughputDistributionResponse + > + >; + /** + * Retrieve throughput distribution for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution + * for the current SQL container. + * @param options The options parameters. + */ + beginSqlContainerRetrieveThroughputDistributionAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + retrieveThroughputParameters: RetrieveThroughputParameters, + options?: SqlResourcesSqlContainerRetrieveThroughputDistributionOptionalParams + ): Promise; + /** + * Redistribute throughput for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. + * @param options The options parameters. + */ + beginSqlContainerRedistributeThroughput( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams + ): Promise< + PollerLike< + PollOperationState< + SqlResourcesSqlContainerRedistributeThroughputResponse + >, + SqlResourcesSqlContainerRedistributeThroughputResponse + > + >; + /** + * Redistribute throughput for an Azure Cosmos DB SQL container + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param databaseName Cosmos DB database name. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for + * the current SQL container. + * @param options The options parameters. + */ + beginSqlContainerRedistributeThroughputAndWait( + resourceGroupName: string, + accountName: string, + databaseName: string, + containerName: string, + redistributeThroughputParameters: RedistributeThroughputParameters, + options?: SqlResourcesSqlContainerRedistributeThroughputOptionalParams + ): Promise; /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. * @param resourceGroupName The name of the resource group. The name is case insensitive. diff --git a/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts b/sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/cosmosdb/arm-cosmosdb/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!"); + }); +});