From 8ca8f3c364a5b5565d2fea94773da93d7ea9e06e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 20 May 2022 07:54:14 +0000 Subject: [PATCH] CodeGen from PR 19158 in Azure/azure-rest-api-specs Merge eac2d30566143f233afb70432edaf20f55b369f3 into a8a52b9e6c305f03c3a4c5411d59fc4454b5b372 --- sdk/cosmosdb/arm-cosmosdb/CHANGELOG.md | 68 ++- sdk/cosmosdb/arm-cosmosdb/_meta.json | 10 +- sdk/cosmosdb/arm-cosmosdb/package.json | 12 +- .../arm-cosmosdb/review/arm-cosmosdb.api.md | 207 +++++++- .../src/cosmosDBManagementClient.ts | 38 +- sdk/cosmosdb/arm-cosmosdb/src/models/index.ts | 271 ++++++++++- .../arm-cosmosdb/src/models/mappers.ts | 375 +++++++++++++- .../arm-cosmosdb/src/models/parameters.ts | 20 +- .../src/operations/dataTransferJobs.ts | 134 ++++- .../src/operations/mongoDBResources.ts | 456 ++++++++++++++++++ .../src/operations/sqlResources.ts | 452 +++++++++++++++++ .../operationsInterfaces/dataTransferJobs.ts | 47 +- .../operationsInterfaces/mongoDBResources.ts | 138 ++++++ .../src/operationsInterfaces/sqlResources.ts | 134 +++++ sdk/cosmosdb/arm-cosmosdb/test/sampleTest.ts | 43 ++ 15 files changed, 2364 insertions(+), 41 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..c708fa3f2220 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-05-20) **Features** @@ -47,12 +37,24 @@ - 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 @@ -71,16 +73,22 @@ - 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 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 +103,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 @@ -126,6 +144,7 @@ - Added Interface RestorableTableResourcesListResult - Added Interface RestorableTablesListOptionalParams - Added Interface RestorableTablesListResult + - Added Interface RetrieveThroughputPropertiesResource - Added Interface Role - Added Interface ServiceCreateOptionalParams - Added Interface ServiceDeleteOptionalParams @@ -138,6 +157,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 +178,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 +211,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 +241,22 @@ - 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 DataCenterResourceProperties has a new optional parameter authenticationMethodLdapProperties - 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 +265,19 @@ - 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 DatabaseAccountGetResults has a new parameter diagnosticLogSettings - Type Alias DatabaseAccountGetResults has a new parameter enableMaterializedViews + - 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..ac3e6dbfca3f 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": "1767abc7459552b08c7089fb1e457c4a16006de5", + "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=/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.3.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..21537089a136 100644 --- a/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md +++ b/sdk/cosmosdb/arm-cosmosdb/review/arm-cosmosdb.api.md @@ -648,6 +648,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 +682,12 @@ export interface ClientEncryptionKeysListResult { readonly value?: ClientEncryptionKeyGetResults[]; } +// @public +export interface ClientEncryptionPolicy { + includedPaths: ClientEncryptionIncludedPath[]; + policyFormatVersion?: number; +} + // @public export interface CloudError { error?: ErrorResponse; @@ -897,8 +911,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; @@ -1431,7 +1454,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 +1467,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 +1519,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 & {}; @@ -1899,6 +1948,7 @@ export type KeyKind = string; // @public export interface KeyWrapMetadata { + algorithm?: string; name?: string; type?: string; value?: string; @@ -2006,6 +2056,14 @@ export enum KnownConnectorOffer { Small = "Small" } +// @public +export enum KnownContinuousTier { + // (undocumented) + Continuous30Days = "Continuous30Days", + // (undocumented) + Continuous7Days = "Continuous7Days" +} + // @public export enum KnownCreatedByType { // (undocumented) @@ -2203,6 +2261,8 @@ export enum KnownServerVersion { // (undocumented) Four0 = "4.0", // (undocumented) + Four2 = "4.2", + // (undocumented) Three2 = "3.2", // (undocumented) Three6 = "3.6" @@ -2258,6 +2318,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 +2493,11 @@ export type MaterializedViewsBuilderServiceResourceProperties = ServiceResourceP readonly locations?: MaterializedViewsBuilderRegionalServiceResource[]; }; +// @public +export interface MergeParameters { + isDryRun?: boolean; +} + // @public export interface Metric { readonly endTime?: Date; @@ -2553,6 +2628,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 +2638,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 +2762,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 +2835,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 +3221,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 +3373,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 +3416,7 @@ export interface RestorableDatabaseAccountGetResult { readonly id?: string; location?: string; readonly name?: string; + oldestRestorableTime?: Date; readonly restorableLocations?: RestorableLocationResource[]; readonly type?: string; } @@ -3658,6 +3814,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 +3954,7 @@ export interface SqlContainerListResult { // @public export interface SqlContainerResource { analyticalStorageTtl?: number; + clientEncryptionPolicy?: ClientEncryptionPolicy; conflictResolutionPolicy?: ConflictResolutionPolicy; defaultTtl?: number; id: string; @@ -3876,6 +4043,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 +4055,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 +4274,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 +4377,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 +4665,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..8428864c8f43 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-02-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..f60df3d746f7 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/index.ts @@ -842,6 +842,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 +894,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 +990,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 { /** @@ -1289,10 +1378,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 +1871,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; /** @@ -2344,6 +2440,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 +2504,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. */ @@ -2631,6 +2735,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 +3123,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 +3251,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 +3420,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 +3431,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 +3738,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 +4054,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 +4567,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 +4622,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 +4911,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 +4970,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 +5627,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..fd0b879a5689 100644 --- a/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts +++ b/sdk/cosmosdb/arm-cosmosdb/src/models/mappers.ts @@ -1973,6 +1973,12 @@ export const KeyWrapMetadata: coreClient.CompositeMapper = { type: { name: "String" } + }, + algorithm: { + serializedName: "algorithm", + type: { + name: "String" + } } } } @@ -2092,6 +2098,13 @@ export const SqlContainerResource: coreClient.CompositeMapper = { className: "ConflictResolutionPolicy" } }, + clientEncryptionPolicy: { + serializedName: "clientEncryptionPolicy", + type: { + name: "Composite", + className: "ClientEncryptionPolicy" + } + }, analyticalStorageTtl: { serializedName: "analyticalStorageTtl", type: { @@ -2408,6 +2421,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", @@ -3204,8 +3466,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 +4879,12 @@ export const RestorableDatabaseAccountGetResult: coreClient.CompositeMapper = { name: "DateTime" } }, + oldestRestorableTime: { + serializedName: "properties.oldestRestorableTime", + type: { + name: "DateTime" + } + }, deletionTime: { serializedName: "properties.deletionTime", type: { @@ -5682,6 +5957,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 +6104,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" + } + } } } }; @@ -6551,6 +6848,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 +7969,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 +8315,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..7891fc32f4f3 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-02-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/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/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!"); + }); +});